]> gitweb.factorcode.org Git - factor.git/blob - core/ui/gadgets/tracks.facts
more sql changes
[factor.git] / core / ui / gadgets / tracks.facts
1 IN: gadgets-tracks
2 USING: help gadgets arrays kernel ;
3
4 HELP: track
5 { $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 " { $link gadget-orientation } ". Tracks are created by calling " { $link <track> } "." }
6 { $see-also make-track make-track* } ;
7
8 HELP: build-track
9 { $values { "track" track } { "specs" array } }
10 { $description "Constructs gadgets and adds them to the track by interpreting " { $snippet "spec" } ", which is an array of quadruples of the form " { $snippet "{ quot setter post ratio }" } ". The quadruples break down as follows:"
11     { $list
12         { { $snippet "quot" } " - a quotation which pushes a new gadget on the stack. The quotation is permitted to consume values from the stack, and it is up to the caller of " { $link build-grid } " to prove the correct amount." }
13         { { $snippet "setter" } " - a word with stack effect " { $snippet "( gadget grid -- )" } ". If " { $snippet "track" } " is a tuple delegating to a " { $link track } ", this can be used to store the new gadget in a tuple slot." }
14         { { $snippet "post" } " - a quotation with stack effect " { $snippet "( gadget -- newgadget )" } ", applied to the gadget before it is added to the grid" }
15         { { $snippet "ratio" } " - a rational number between 0 and 1 which determines the space allocation received by the child." }
16     }
17 }
18 { $see-also make-track make-track* } ;
19
20 HELP: make-track
21 { $values { "specs" array } { "track" track } }
22 { $description "Creates a new track from a declarative specification. See " { $link build-track } " for a description of the format of " { $snippet "spec" } "." } ;
23
24 HELP: make-track*
25 { $values { "tuple" tuple } { "specs" array } { "track" track } }
26 { $description "Creates a new track from a declarative specification and sets " { $snippet "tuple" } "'s delegate to the new track. See " { $link build-track } " for a description of the format of " { $snippet "spec" } "." } ;