9 Creating Your Own Panes
These graphical objects are called pinboard objects, as they can only be displayed if they are contained within apinboard-layout
. To define a pinboard-object, you define a subclass ofdrawn-pinboard-object
and specify a drawing routine for it (and you can also specify constraints on the size of your object). You can then make instances of these objects and place them into layouts just as if they were ordinary panes. You can also place these objects inside layouts as long as there is a pinboard-layout higher up the layout hierarchy that contains the panes.
Here is an example of the built-in pinboard object class item-pinboard-object
which displays its text like a title-pane. Note that the function contain
always creates a pinboard-layout as part of the wrapper for the object to be contained, and so it is possible to contain pinboard-objects in just the same way as you can contain other classes of CAPI object.
(contain (make-instance 'item-pinboard-object :text "Hello world"))
Figure 9.4 A pinboard object
Generated with Harlequin WebMaker