All Manuals > CAPI User Guide > 6 Choices


6.2 List panels

Lists of selectable items can be created with the list-panel class. Here is a simple example of a list panel:

(setq list 
      (make-instance 'list-panel
                     :items '(one two three four)
                     :visible-min-height '(character 2)
                     :print-function 'string-capitalize))
(contain list)

Figure 6.4 A list panel

Notice how the items in the list panel are passed as symbols, and a print-function is specified which controls how those items are displayed on the screen.

Any item on the list can be selected by clicking on it with the mouse.

By default, list panels are single selection -- that is, only one item in the list may be selected at once. You can use the :interaction keyword to change this:

(make-instance 'list-panel
               :items (list "One" "Two" "Three" "Four")
               :interaction :multiple-selection)
(contain *)

You can add callbacks to any items in the list using the :selection-callback keyword.

(make-instance 'list-panel
               :items (list "One" "Two" "Three" "Four")
               :selection-callback 'test-callback)
(contain *)

6.2.1 List interaction

6.2.2 Extended selection

6.2.3 Deselection, retraction, and actions

6.2.4 Selections

6.2.5 Images and appearance

6.2.6 Filters

CAPI User Guide (Windows version) - 30 Aug 2011