CAPI User Guide, Liquid Common Lisp Version 5.0
In most collections, items may be selected by the user -- for example, a row of buttons. Collections whose items can be selected are known as choices. Each button in a row of buttons is either checked or unchecked, showing something about the application's state -- perhaps that color graphics are switched on and sound is switched off. This selection state came about as the result of a choice the user made when running the application, or default choices made by the application itself.
The CAPI provides a convenient way of producing groups of items from which collections and choices can be made. The abstract classcollection
provides a means of specifying a group of items. The subclass choice
provides groups of selectable items, where you may specify what initial state they are in, and what happens when the selection is changed. Subclasses ofcollection
andchoice
used for producing particular kinds of grouped elements are described in the sections that follow.
All the choices described in this chapter can be given a print function via the:print-function
keyword. This allows you to control the way in which items in the element are displayed. For example, passing the argument'string-capitalize
to:print-function
to would capitalize the initial letters of all the words of text that an instance of a choice displays.
Some of the examples in this chapter require the functionstest-callback
andhello
which were introduced in Chapter 3, "Creating Common Windows".
Generated with Harlequin WebMaker