Next Previous Up Top Contents Index

8.11 DUIM-Gadgets Module

gadget-label-key

Generic function

Summary

Returns the function that is used to compute the label for the items in the specified gadget.

Signature

gadget-label-key gadget => label-key

Arguments

gadget
An instance of type <collection-gadget>.

Values

label-key
An instance of type <function>.

Library

duim-gadgets

Module

duim-gadgets

Description

Returns the function that is used to compute the labels for the items in gadget. Using a label key can be a useful way of consistently specifying labels that are a mapping of, but not directly equivalent to, the item names. As shown in the example, it is possible to force the case of item labels, and this is useful if the items are specified as symbol names, rather than strings.

Example

The following code creates a list box whose items are the lower-cased equivalents of the symbols stated.

*gadget* := contain
              (make(<list-box>, 
                    items: #(#"One", #"Two", #"Three"),
                    label-key: 
                      method (symbol) 
                       as-lowercase
                         (as(<string>, symbol)) 
                      end));

The label key function can be returned as follows:

gadget-label-key(*gadget*);

See also

gadget-label, page 569

gadget-label-setter, page 571

gadget-value-key, page 589


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index