Abstract instantiable class
The class of all space requirement objects.
<object>
width:<integer>. Default value: $fill.
min-width:<integer>. Default value: width.
max-width:<integer>. Default value: width.
height:<integer>. Default value: $fill.
min-height:<integer>. Default value: height.
max-height:<integer>. Default value: height.
label: type-union(<string>, <image>).
duim-layouts
duim-layouts
The class of all space requirement objects. This type of object is used to reserve space when it is required in a layout in order to accommodate gadgets or other layouts.
The various init-keywords let you constrain the width and height of the object in a variety of ways.
If no init-keywords are specified, the object returned tries to fill all the available space.
Specifying width: or height: specifies the preferred width or height of the object.
Specifying any of the min- or max- init-keywords lets you minimum and maximum width or height for the object.
The following inequalities hold for all widths and heights:
min-height: <= height: <= max-height: min-width: <= width: <= max-width:
If either min-width: or min-height: is 0, the object is "infinitely shrinkable" in that direction. If either max-width: or max-height: is $fill, the object is "infinitely stretchable" in that direction. The latter is a particularly useful way of ensuring that objects fill the available width, and can be used, say, to ensure that a series of buttons fill the entire width of the layout that they occupy.
An example of the use of max-width: to force the size of a button to fit the available space can be found in the entry for <button>, page 532.
The label: init-keyword specifies a label which is measured to give the preferred width and height.
space-requirement-height space-requirement-max-height space-requirement-max-width space-requirement-min-height space-requirement-min-width space-requirement-width
Given the following definition of a button class:
define class <basic-test-button>
(<leaf-pane>)
end class <basic-test-button>; The following method for do-compose-space creates the necessary space requirements to accommodate the new button class in a layout.
define method do-compose-space
(pane :: <basic-test-button>, #key width, height)
=> (space-req :: <space-requirement>)
ignore(width, height);
make(<space-requirement>,
width: 40,
height: 15)
end method do-compose-space;