Next Previous Up Top Contents Index

8.11 DUIM-Gadgets Module

gadget-selection-setter

Generic function

Summary

Sets the selection of the specified gadget.

Signature

gadget-selection-setter selection gadget #key do-callback? =>
selection

Arguments

selection
An instance of type limited(<sequence>, of: <integer>).

gadget
An instance of type <collection-gadget>.

do-callback?
An instance of type <boolean>. Default value: #f.

Values

selection
An instance of type limited(<sequence>, of: <integer>).

Library

duim-gadgets

Module

duim-gadgets

Description

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.

Example

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).

See also

gadget-selection, page 578

gadget-selection-mode, page 579

gadget-value-setter, page 592


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index