19.6.3 Callbacks for menu items

Both menu items in the interface need a callback function. As with other callback functions, these are specified by defining a general callback, display-pane-selection , which displays, in a dialog, the current selection of any pane.

(defun display-pane-selection (reader data interface)
  (declare (ignore data))
  (capi:display-message "~S: ~S selected"
                         (funcall reader interface)) 
                         (funcall reader interface))))

The following two functions call display-pane-selection , passing the reader of a pane as an argument. These functions are specified as the callbacks for the two menu items.

(defun display-graph-selection (&rest args)
  (apply 'display-pane-selection 'graph-reader args))
(defun display-list-selection (&rest args)
  (apply 'display-pane-selection 'list-reader args))

As with the other callback functions, specifying the callbacks in this way allows for easy extension of the example.

Common LispWorks User Guide (Unix version) - 21 Feb 2008