The size of a layout (often referred to as its geometry ) is calculated automatically on the basis of the size of each of its children. The algorithm used takes account of hints provided by the children, and from the description of the layout itself. Hints are specified via the panes' initargs when they are created. The various pane classes have useful default values for these initargs.
This is designed to work regardless of variable factors such as the user's configuration, for example specifying large font sizes. It is often wrong to constrain CAPI elements to fixed pixel sizes, as these constraints may lead to poorer layouts in some configurations.
For information about the effect of constraints on scrolling, see Width and height hints.
Hints can take arguments in a number of formats, which are described in full under Hint values formats. 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 section.
In Combining different layouts, 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.
Now display a window similar to the last example, but with the
editor2 editor pane. Note that it is only the description of the top-level column layout which differs. Before entering the following into the listener, you should close all the windows created in this chapter in order to free up the instances of
button2 and so forth.
If you define your own pinboard-object class, ensure that its hint table matches the visible geometry and is kept synchronised after any movement of the object, otherwise redrawing may be incorrect.
CAPI User Guide and Reference Manual (Macintosh version) - 25 Feb 2015