So far you have only seen two types of CAPI element: the interface (which is the top level CAPI element, and is present in any CAPI window) and the push-button. This section shows how you can use the CAPI to create other common windowing elements you are likely to need.
Before trying out the examples in this chapter, define the functions test-callback
and hello
in your Listener. The first displays the list of arguments it is given, and returns nil
. The second just displays a message.
(defun test-callback (data interface)
(display-message "Data ~S in interface ~S"
data interface))
(defun hello (data interface)
(declare (ignore data interface))
(display-message "Hello World"))
We will use these callbacks in future examples.