pack
Factor handbook > UI framework > Building user interfaces > Gadget hierarchy and layouts > Pack layouts

Next:<pack> ( orientation -- pack )


Vocabulary
ui.gadgets.packs

Class description
A gadget which lays out its children along a single axis stored in the orientation slot. Can be constructed with one of the following words:
<pack>
<pile>
<shelf>

Packs have the following slots:
align a rational number between 0 and 1, or +baseline+; the alignment of gadgets along the axis perpendicular to the pack's orientation
fill a rational number between 0 and 1, where 0 gives each gadget its preferred size and 1 fills the dimension perpendicular to the pack's orientation
gap a pair of integers, the horizontal and vertical gap between children

Custom gadgets can inherit from the pack class and implement their own pref-dim* and layout* methods, reusing pack layout logic by calling pack-pref-dim and pack-layout.

Definition


Methods