Next Previous Up Top Contents Index

8.11 DUIM-Gadgets Module

gadget-selection

Generic function

Summary

Returns the currently selected items of the specified gadget.

Signature

gadget-selection gadget => selection

Arguments

gadget
An instance of type <collection-gadget>.

Values

selection
An instance of type limited(<sequence>, of: <integer>). Default value: #[].

Library

duim-gadgets

Module

duim-gadgets

Description

Returns the keys for the currently selected items of gadget. Generally, you should use gadget-value to return the selected item, rather than gadget-selection, which is best used for handling repeated items.

Single selection gadgets (such as radio boxes) always have exactly one key selected. Multiple selection gadgets (such as check boxes) have zero or more keys selected. The value of a collection gadget is determined by calling the value key of the gadget on each selected item in the gadget.

Example

Create a radio box as follows:

*radio* := contain(make(<radio-box>, 
                        items: range(from: 0, to: 5)));

Select one of the items in the radio box. This selection can be returned with:

gadget-selection(*radio*);

See also

gadget-items, page 566

gadget-selection-mode, page 579

gadget-selection-setter, page 580

gadget-value, page 585


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index