Generic function
Returns the function that is used to calculate the gadget value of the specified gadget.
gadget-value-key gadget => value-key
<collection-gadget>.
<function>. Default value: identity.
duim-gadgets
duim-gadgets
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.
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*);
gadget-label-key, page 570
gadget-value, page 585