A layout that allows its children to be positioned anywhere within itself.
capi
:fit-size-to-children | |
A generalized boolean. |
The class static-layout
is a layout that allows its children to be positioned anywhere within itself.
When a static-layout
lays out its children, it positions them at the x and y specified as hints (using :x
and :y
), and sizes them to their minimum size (which can be specified using :visible-min-width
and :visible-max-width
).
If fit-size-to-children is true, the static-layout
is made sufficiently large to accommodate all of its children, and grows and modifies its scrollbars (if they exist) if necessary when a child is added. This is the default behavior. Otherwise the static layout has a minimum size of one pixel by one pixel which is not affected by the size of its children. If you need the sizing capabilities, then use the class simple-layout which surrounds a single child, and adopts the size constraints of that child.
Here is an example of a static layout placing simple panes at arbitrary positions inside itself.
(capi:contain (make-instance 'capi:static-layout :description (list (make-instance 'capi:text-input-pane :x 20 :y 100) (make-instance 'capi:push-button-panel :x 30 :y 200 :items '(1 2 3)))) :best-width 300 :best-height 300)
There are further examples in 20 Self-contained examples.
CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:33:57