4.2 List panels

4.2.3 Deselection, retraction, and actions

As well as selecting items, users often want to deselect them. Items in multiple-selection and extended-selection lists may be deselected.

In a multiple-selection list, deselection is done by clicking on the selected item again with either of the selection or extension gestures.

In an extended-selection list, deselection is done by performing the extension gesture upon the selected item. (If this was done using the selection gesture, the list would behave as a single-selection list and all other selections would be lost.)

Just like a selection, a deselection -- or retraction -- can have a callback associated with it.

For a multiple-selection list pane, there may be the following callbacks:

Consider the following example. The functionset-title changes the title of the interface to the value of the argument passed to it. By using this as the callback to thecheck-button-panel, the title of the interface is set to the current selection. The functionretract-callback returns a message dialog with the name of the button retracted.

(defun set-title (data interface)
  (setf (interface-title interface)
        (format nil "~S" data)))

(make-instance 'check-button-panel :items '(one two three four five) :print-function 'string-capitalize :selection-callback 'set-title :retract-callback 'test-callback)

(contain *)

Figure 4.5 An example of a callback to a check-button panel

For an extended-selection list pane, there may be the following callbacks:

Also available in extended-selection and single-selection lists is the action callback. This is called when you double-click on an item.


CAPI User Guide, Liquid Common Lisp Version 5.0 - 2 OCT 1997

Generated with Harlequin WebMaker