Generic function
Sets the selection of the specified gadget.
gadget-selection-setter selection gadget #key do-callback? =>
selection
limited(<sequence>, of: <integer>).
<collection-gadget>.
<boolean>. Default value: #f.
limited(<sequence>, of: <integer>).
duim-gadgets
duim-gadgets
Sets the selection of gadget. When setting the selection, you need to be wary of the selection mode for gadget. It is an error to try to set multiple items in a single selection mode gadget.
If do-callback? is true, the selection callback for gadget is invoked.
As with gadget-selection, you should usually use gadget-value-setter to set the selected item, rather than gadget-selection-setter, which is best used for handling repeated items. See gadget-selection, page 578 for more details.
Create a radio box as follows:
*radio* := contain(make(<radio-box>,
items: range(from: 0, to: 5)));You can select the third item with:
gadget-selection(*radio*, do-callback?: #t) := #[3];
This sets the appropriate item, and invokes the callback that would have been invoked had the item been set manually, rather than programmatically (assuming that such a callback has been defined).
gadget-selection, page 578
gadget-selection-mode, page 579
gadget-value-setter, page 592