The interaction style of the choice.
The indexes of the choice's selected items.
choice inherits most of its behavior from collection, and then provides the selection facilities itself. The classes list-panel, button-panel, option-pane, menu-component and graph-pane inherit from it, and so it plays a key role in CAPI applications.
The choice behaves just as a collection.
:single-selection, the choice can only have one item selected at a time. When a new selection is made, the old selection is cleared and its
is called. The
is also called when the user invokes the selection gesture on the selected item.
:multiple-selection, the choice can have any number of items selected, and selecting an item toggles its selection status. The
is called when an item becomes selected, and the
is called when an item is deselected.
:multiple-selection is not supported for lists on Mac OS X.
:extended-selection, the choice can have any number of items selected as with
:multiple-selection interaction, but the usual selection gesture removes the old selection. However, there is a window system-specific means of extending the selection. When an item is selected the
is called, when the selection is extended the
is called, and when an item is deselected the
On Mac OS X, the selection gesture is mouse (left button) click. Deselection and discontinuous selections are made by
Command+Click, and a continuous selection is made by
Shift+Click, regardless of whether if
The choice's selection stores the indices of the currently selected item, and is a single number for single selection choices and a list for all other interactions. Therefore when calling
(setf choice-selection) you must pass an integer or
:single-selection, and you must pass a list of integers if
:extended-selection.The functions choice-selected-item and choice-selected-items treat the selection in terms of the items themselves as opposed to their indices.
(setf (capi:choice-selection choice) 1)
CAPI User Guide and Reference Manual (Macintosh version) - 3 Aug 2017