This section shows you how to specify all the callbacks necessary for each element in the example interface, together with other attributes that are required for correct operation of the callback functions. You need to specify attribute values for the display pane, the list panel and the graph pane.
Selection-Text
in the layout hierarchy and display the Attributes dialog.
selection-reader
and click
OK
.This reader allows the display pane to be identified by the callback code.
For the list panel, you need to specify four callbacks and a reader.
List
in the layout hierarchy and display its Attributes dialog.
list-reader
. Do not click
OK
yet.Like the display pane, this reader is necessary so that the list panel can be identified by the callback code.
Next, you need to specify the following four types of callback (make sure you click the Callbacks tab):
Selection callback. The function that is called when you select a list item.
Extend callback. The function that is called when you extend the current selection.
Retract callback. The function that is called when you deselect a list item.
Action callback. The function that is called when you double-click on a list item.
Selection-Callback to
'update-selection-select
Extend-Callback to
'update-selection-extend
Retract-Callback to
'update-selection-retract
Action-Callback to
'display-selection-in-dialog
Graph
graph pane and display its Attributes dialog.For the graph pane, you need to set the same four callbacks, as well as a reader, and two other attributes that are important for the callback code to run correctly.
Selection-Callback to
'update-selection-select
Extend-Callback to
'update-selection-extend
Retract-Callback to
'update-selection-retract
Action-Callback to
'display-selection-in-dialog
graph-reader
.(defun children-function (x)
(when (< x 8)
(list (* x 2) (1+ (* x 2)))))
Now set the Children-Function attribute to
'children-function
.
The children function defines what is drawn in the graph, and so is vital for any graph pane. It is called when displaying the prototype interface, so it is best to define it before setting this attribute.
LispWorks IDE User Guide (Windows version) - 25 Nov 2011