5.4.3 Constraint Formats

Hints can take arguments in a number of formats, which are described in full in the LispWorks CAPI Reference Manual . When given a number, this should be an integer and the layout is constrained to that number of pixels. A constraint can also be specified in terms of character widths or heights, as shown in the next example.

In the last section, you created a window with five panes, by combining row and column layouts. Now consider changing the definition of the editor pane so that it is required to have a minimum size. This would be a sensible change to make, because editor panes need to be large enough to work with comfortably.

(setq editor2 
      (make-instance 'editor-pane
                     :text "An editor pane with minimum size"
                     :visible-min-width '(:character 30)
                     :visible-min-height '(:character 10)))

Now display a window similar to the last example, but with the editor2 editor pane. Note that it is only the decription of the top-level column layout which differs. Before typing the following into the listener, you should close all the windows created in this chapter in order to free up the instances of button1 , button2 and so forth.

(contain (make-instance 'column-layout
                        (list row1 row2 editor2)))

You will not be able to resize the window any smaller than this:

Figure 5.6 The result of resizing the sample layout

LispWorks CAPI User Guide (Macintosh version) - 8 Apr 2005