Next Previous Up Top Contents Index

8.11 DUIM-Gadgets Module

gadget-value

Generic function

Summary

Returns the gadget value of the specified gadget.

Signature

gadget-value gadget => gadget-value

Arguments

gadget
An instance of type <value-gadget>.

Values

gadget-value
An instance of type <object>.

Library

duim-gadgets

Module

duim-gadgets

Description

Returns the gadget value of the specified gadget.

The interpretation of the value varies from gadget to gadget. Most gadgets conceptually have "raw" values that can be determined directly using the generic function appropriate to the gadget class concerned (gadget-text for an instance of <text-gadget>, gadget-selectionfor an instance of <collection-gadget>, and so on). These gadget classes also have a convenience method on gadget-value that wraps up the raw value in some useful way. So, text gadgets have a method on gadget-value that converts the gadget-textbased on the gadget-value-type, for example converting the string to an integer for value-type: <integer>.

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.

Note: If the gadget ID has been specified for a tab control, then this is returned as the gadget value.

Example

Create a radio button:

*radio* := contain(make(<radio-button>, 
                        label: "Radio"));

The gadget value of *radio* can be returned as follows:

gadget-value(*radio*);

If the radio button is selected, gadget-value returns #t. If not selected, gadget-value returns #f.

See also

<gadget>, page 549

gadget-id, page 564

gadget-value-key, page 589

gadget-value-range, page 590

gadget-value-setter, page 592

gadget-value-type, page 593


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index