track
Factor documentation > Factor handbook > UI framework > Building user interfaces > Gadget hierarchy and layouts > Track layouts
Next:<track> ( orientation -- track )


Vocabulary
ui.gadgets.tracks

Class description
A track is like a pack except each child is resized to a fixed multiple of the track's dimension in the direction of orientation. Tracks are created by calling <track>.

Definition
USING: ui.gadgets.packs ;

IN: ui.gadgets.tracks

TUPLE: track < pack sizes ;


Methods
USING: kernel ui.gadgets ui.gadgets.packs ui.gadgets.tracks
ui.gadgets.tracks.private ;

M: track layout* dup track-layout pack-layout ;


USING: accessors kernel math.vectors ui.gadgets
ui.gadgets.tracks ui.gadgets.tracks.private ;

M: track pref-dim*
[ track-pref-dims-1 ]
[ [ alloted-dim ] [ track-pref-dims-2 ] bi v+ ]
[ orientation>> ] tri set-axis ;


USING: accessors generic kernel sequences ui.gadgets
ui.gadgets.tracks ;

M: track remove-gadget
[ [ children>> index ] [ sizes>> ] bi remove-nth! drop ]
[ M\ track remove-gadget (call-next-method) ] 2bi ;