1 USING: ui.gadgets help.markup help.syntax arrays ;
4 ARTICLE: "ui-grid-layout" "Grid layouts"
5 "Grid gadgets layout their children in a rectangular grid."
7 "Creating grids from a fixed set of gadgets:"
10 { $subsection grid-add }
11 { $subsection grid-remove }
12 { $subsection grid-child } ;
15 { $class-description "A grid gadget lays out its children so that all gadgets in a column have equal width and all gadgets in a row have equal height."
17 "The " { $snippet "gap" } " slot stores a pair of integers, the horizontal and vertical gap between children, respectively."
19 "The " { $snippet "fill?" } " slot stores a boolean, indicating if grid cells should assume their preferred size, or if they should fill the dimensions of the cell. The default is " { $link t } "."
21 "Grids are created by calling " { $link <grid> } " and children are managed with " { $link grid-add } " and " { $link grid-remove } "."
23 "The " { $link add-gadget } ", " { $link unparent } " and " { $link clear-gadget } " words should not be used to manage child gadgets of grids." } ;
26 { $values { "children" "a sequence of sequences of gadgets" } { "grid" "a new " { $link grid } } }
27 { $description "Creates a new " { $link grid } " gadget with the given children." } ;
30 { $values { "grid" grid } { "i" "non-negative integer" } { "j" "non-negative integer" } { "gadget" gadget } }
31 { $description "Outputs the child gadget at the " { $snippet "i" } "," { $snippet "j" } "th position of the grid." }
32 { $errors "Throws an error if the indices are out of bounds." } ;
35 { $values { "grid" grid } { "child" gadget } { "i" "non-negative integer" } { "j" "non-negative integer" } }
36 { $description "Adds a child gadget at the specified location." }
37 { $side-effects "grid" } ;
40 { $values { "grid" grid } { "i" "non-negative integer" } { "j" "non-negative integer" } }
41 { $description "Removes a child gadget from the specified location." }
42 { $side-effects "grid" } ;
44 ABOUT: "ui-grid-layout"