]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/gadgets/tracks/tracks-docs.factor
9ed5bf422394dbf5ec0026913f8d1099732ee988
[factor.git] / basis / ui / gadgets / tracks / tracks-docs.factor
1 USING: ui.gadgets.packs help.markup help.syntax ui.gadgets
2 arrays kernel quotations classes.tuple ;
3 IN: ui.gadgets.tracks
4
5 ARTICLE: "ui-track-layout" "Track layouts"
6 "Track gadgets are like " { $link "ui-pack-layout" } " except each child is resized to a fixed multiple of the track's dimension."
7 { $subsection track }
8 "Creating empty tracks:"
9 { $subsection <track> }
10 "Adding children:"
11 { $subsection track-add } ;
12
13 HELP: track
14 { $class-description "A track is like a " { $link pack } " except each child is resized to a fixed multiple of the track's dimension in the direction of " { $snippet "orientation" } ". Tracks are created by calling " { $link <track> } "." } ;
15
16 HELP: <track>
17 { $values { "orientation" "an orientation specifier" } { "track" "a new " { $link track } } }
18 { $description "Creates a new track which lays out children along the given axis. Children are laid out vertically if the orientation is " { $snippet "{ 0 1 }" } " and horizontally if the orientation is " { $snippet "{ 1 0 }" } "." } ; 
19
20 HELP: track-add
21 { $values { "gadget" gadget } { "track" track } { "constraint" "a number between 0 and 1, or " { $link f } } }
22 { $description "Adds a new child to a track. If the constraint is " { $link f } ", the child always occupies its preferred size. Otherwise, the constrant is a fraction of the total size which is allocated for the child." } ;
23
24 ABOUT: "ui-track-layout"