LispWorks CAPI User Guide > 5 Choices


5.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 5.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 *)

5.2.1 List interaction

5.2.2 Extended selection

5.2.3 Deselection, retraction, and actions

5.2.4 Selections

5.2.5 Filters

LispWorks CAPI User Guide (Macintosh version) - 22 Dec 2009