Open abstract class
The class of all gadgets that contain collections.
items:<sequence>. Default value: #[].
label-key: <function>.
value-key:<function>. Default value: identity.
test:<function>. Default value: ==.
selection:limited(<sequence>, of: <integer>). Default value: #[].
selection-mode: An instance of type one-of(#"single", #"multiple", #"none"). Default value: #"single".
key-press-callback: An instance of type false-or(<command>, <function>).
duim-gadgets
duim-gadgets
The class of all gadgets that can contain collections.
The items: init-keyword is used to specify the collection of items that the collection gadget contains.
The label-key: and value-key: init-keywords are functions that are used to calculate the labels and the value of the gadget respectively.
The value of a collection gadget is determined by calling the value key of the gadget on each selected item in the gadget. The "printed representation" of a collection gadget is determined by calling the label key of the gadget on each item.
By default, the label key returns the numeric label of the gadget items (for example, the buttons in a button box would be labeled 1, 2, 3, and so on). In general, the label key can be trusted to "do the right thing" by default.
By default, the value key returns the collection gadget itself.
Note also that the gadget-value method for collection gadgets is different for single and multiple selection gadgets. For single selection, the item that is selected is returned. For multiple selection, a sequence of the selected items is returned.
The test: init-keyword is the function used to test whether two items of the collection are considered identical.
The selection: init-keyword is available only to those subclasses of <collection-gadget> that contain items that may be selected. The selection is a collection containing the selected keys from the items collection.
Subclasses of <collection-gadget> that can have selections are: <list-box>, <option-box>, <list-control>, <tree-control>, <table-control>, <radio-box>, <check-box>, <check-menu-box>, <radio-menu-box>, <combo-box>.
The key-press-callback: init-keyword lets you specify a key-press callback. This type of callback is invoked whenever a key on the keyboard is pressed while the gadget has focus. It applies only to graph controls, list controls, tab controls, and table controls. See gadget-key-press-callback, page 567, for a fuller description of key-press callbacks.
gadget-items gadget-items-setter gadget-key-press-callback gadget-key-press-callback-setter gadget-label-key gadget-selection gadget-selection-mode gadget-selection-setter gadget-test gadget-value-key