A view that displays a list of text items and allows one or more of them to be selected, depending on -selectionMode.
In default selection mode (single item selection), clicking on an item will select it, and pressing the up or down arrow keys will move selection to previous or next item, respectively. Other selection modes allow more complex interaction.
There is a difference between the concepts of current item, end selected items. In default selection mode they will always be the same, but not so in other modes.
The list of items displayed by the view.
stringArray |
An Array of Strings, each String defining the text to represent an item. |
Removes all items.
The index of the current item, or nil when there is no current item. Note that this may be different than -selection when -selectionMode allows multiple items to be selected.
val |
An Integer or nil. |
An array of all selected indexes. When setting selection, either an array or a single integer may be used.
Note that this may be different than -value when -selectionMode allows multiple items to be selected. When setting selection in single-item selection mode, only the last index will remain selected.
The background colors of the items.
colorArray |
An Array of Colors, one Color for each item. |
The color used to display all the text of all unselected items.
color |
A Color. |
The color used to display the selected item's text.
color |
A Color. |
The color used to indicate the selected item (aside from the color of its text).
color |
A Color. |
The allowed mode of item selection, according to the following table:
Value | Meaning |
\none | No item can be selected. |
\single | Only a single item can be selected at once. |
\multi | Multiple items can be selected. An item's selection is toggled when clicked. |
\extended | Multiple items can be selected, individually by holding the Ctrl key, and in a batch by holding the Shift key. |
\contiguous | Multiple neighbouring items can be selected by holding the Shift key. |
mode |
One of the Symbols listed in the table above. |
The action object evaluated whenever the user changes the current item, i.e. when -value changes as a result of GUI interaction.
The action object evaluated whenever -selection changes.
The action object evaluated whenever the user presses the Enter (Return) key.
Implements the default effects of key presses as follows:
Key | Effect |
space | select next item and trigger action |
r | trigger enterKeyAction |
n | trigger enterKeyAction |
a number | trigger enterKeyAction |
up arrow | select previous item and trigger action |
down arrow | select next item and trigger action |
left arrow | select previous item and trigger action |
right arrow | select next item and trigger action |
The -value.
True if the current drag data is a number.
Sets -valueAction to the current drag data.
Use ListView to switch filters: