1 USING: help.syntax ui.gadgets kernel arrays quotations tuples
2 ui.gadgets.grids ui.gadgets.frames ;
5 : $ui-frame-constant ( element -- )
7 { $description "Symbolic constant for a common input to " { $link grid-add } " and " { $link frame, } "." } print-element ;
9 HELP: @center $ui-frame-constant ;
10 HELP: @left $ui-frame-constant ;
11 HELP: @right $ui-frame-constant ;
12 HELP: @top $ui-frame-constant ;
13 HELP: @bottom $ui-frame-constant ;
14 HELP: @top-left $ui-frame-constant ;
15 HELP: @top-right $ui-frame-constant ;
16 HELP: @bottom-left $ui-frame-constant ;
17 HELP: @bottom-right $ui-frame-constant ;
20 { $class-description "A frame is a gadget which lays out its children in a 3x3 grid. If the frame is enlarged past its preferred size, the center gadget fills up available room."
22 "Frames are constructed by calling " { $link <frame> } " and since they delegate to " { $link grid } " instances, children can be managed with " { $link grid-add } " and " { $link grid-remove } "." } ;
25 { $values { "frame" frame } }
26 { $description "Creates a new " { $link frame } " for laying out gadgets in a 3x3 grid." } ;
28 { <frame> make-frame build-frame } related-words
31 { $values { "quot" quotation } { "frame" frame } }
32 { $description "Creates a new frame. The quotation can add children by calling the " { $link frame, } " word." } ;
35 { $values { "tuple" tuple } { "quot" quotation } }
36 { $description "Creates a new frame and sets " { $snippet "tuple" } "'s delegate to the new frame. The quotation can add children by calling the " { $link frame, } " word, and access the frame by calling " { $link g } " or " { $link g-> } "." } ;
39 { $values { "gadget" gadget } { "i" "non-negative integer" } { "j" "non-negative integer" } }
40 { $description "Adds a child gadget at the specified location. This word can only be called inside the quotation passed to " { $link make-frame } " or " { $link build-frame } "." } ;
42 { grid frame } related-words