All Manuals > CAPI User Guide > 6 Choices > 6.1 Button classes


6.1.1 Push button panels

The arrangement of a number of push buttons into one group can be done with a push-button-panel . Since this provides a panel of buttons which do not maintain a selection when you click on them, push-button-panel is a choice that does not allow a selection. When a button is activated it causes a :selection-callback , but the button does not maintain the selected state.

Here is an example of a push button panel:

(make-instance 'push-button-panel
               :items '(one two three four five)
               :selection-callback 'test-callback
               :print-function 'string-capitalize)
(contain *)

Figure 6.1 A push button panel

The layout of a button panel (for instance, whether items are listed vertically or horizontally) can be specified using the :layout-class keyword. This can take two values: 'column-layout if you wish buttons to be listed vertically, and 'row-layout if you wish them to be listed horizontally. The default value is 'row-layout . If you define your own layout classes, you can also use these as values to :layout-class . Layouts, which apply to many other CAPI objects, are discussed in detail in Laying Out CAPI Panes.

CAPI User Guide (Windows version) - 30 Aug 2011