Next Previous Up Top Contents Index

8.11 DUIM-Gadgets Module

gadget-value-key

Generic function

Summary

Returns the function that is used to calculate the gadget value of the specified gadget.

Signature

gadget-value-key gadget => value-key

Arguments

gadget
An instance of type <collection-gadget>.

Values

value-key
An instance of type <function>. Default value: identity.

Library

duim-gadgets

Module

duim-gadgets

Description

Returns the function that is used to calculate the gadget value of gadget, given the selected items. The function takes an item and returns a value.

Example

The list box defined below has three items, each of which is a pair of two symbols. A label-key and a value-key is defined such that the label for each item is calculated from the first symbol in each pair, and the gadget value is calculated from the second.

*list* := contain(make(<list-box>, 
                       items: #(#("One", #"one"),
                                #("Two", #"two"),
                                #("Three", #"three")),
                       label-key: first, 
                       value-key: second));

This ensures that while the label of the first item is displayed on-screen as One, the value returned from that item is #"one", and similarly for the other items in the list.

The gadget value key function can be returned with:

gadget-value-key(*list*);

See also

gadget-label-key, page 570

gadget-value, page 585


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index