EZLists:
Filter:
Classes | GUI > EZ-GUI

EZLists

An abstract superclass for EZListView and EZPopUpMenu
Location: NOT INSTALLED!

Description

Users will not normally directly create instances of EZLists, but only use it through its subclasses. It provides the basic mechanisms for EZListView and EZPopUpMenu.

Class Methods

.new

Inherited class methods

Instance Methods

Building and Changing the List

.globalAction

Set/get the global function to be performed in addition to the item functions: { arg listObj; value }.

.items

Set/get an Array of Associations including the labels and the item functions: ['label' -> { arg listObj; value }, ].

Discussion:

In menus, the macOS graphics system gives special meanings to some characters. See PopUpMenu ; Or and Array Symbols (if you are only using globalAction). Arrays of Symbols will get converted into and array of Associations with and empty Function ['label' -> {}, ].

.item

Returns:

the item label of the current selection.

.itemFunc

Returns:

the item function of the current selection.

.addItem

Adds an item.

Arguments:

name

An instance of String or Symbol. The name of the list/menu item.

action

An instance of Function.

.insertItem

Inserts a list/menu item at index position.

Arguments:

index

An Integer. The index where to insert an item.

name

An instance of String or Symbol. The name of the list/menu item.

action

An instance of Function.

.replaceItemAt

Replace a list/menu item at index position.

Arguments:

index

An Integer. The index where to insert an item.

name

An instance of String or Symbol. The name of the list/menu item. Default is the current item label.

action

An instance of Function. Default is the current item action.

.removeItemAt

Removes a list/menu item at index position.

Arguments:

index

An Integer. The index where to remove an item.

.remove

Removes both the view, label and the list/menu from the parent view.

Accessing Values

.value

Gets/sets the list/menu to the index at value. Does not perform the action.

Arguments:

val

An Integer.

.valueAction

Sets the value and performs the action at the index value and the global action.

Arguments:

val

An Integer.

.doAction

Performs the action at the current index and the global action.

.initViews

Called by init and overridden by all subclasses. This is where the class specific views are built.

Inherited instance methods