3.2 Specifying titles

3.2.2 Specifying titles directly

You can specify a title directly to all CAPI panes, using the:title keyword. This is much easier than using title-panes, since it does not necessitate using a layout to group two elements together.

Any class that is a subclass oftitled-pane supports the:title keyword. All of the standard CAPI panes inherit from this class. You can find out all the subclasses oftitled-pane by graphing them using the class browser.

The position of any title can be specified by using the:title-position keyword. Most panes default the title-position to :top, although some use:left.

The title of a CAPI element may be changed interactively with the use ofsetf, if you wish.

1. Create a push button by evaluating the code below:

(setq button (make-instance 'push-button
                           :text "Hello"
                           :title "Press: "
                           :title-position :left
                           :callback 'hello))

(contain button)

2. Now evaluate the following:

(setf (titled-pane-title button) "Press here: ")

As soon as the form is evaluated, the title of the pane you just created changes. Notice how the window automatically resizes to make allowance for the size of the new title.


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

Generated with Harlequin WebMaker