2 USING: help gadgets-text gadgets-tracks ;
5 { $values { "gadget" gadget } }
6 { $contract "Called to notify the gadget it has become visible on the screen. This should set up timers and threads, and acquire any resources used by the gadget." }
7 { $see-also ungraft* } ;
10 { $values { "gadget" gadget } }
11 { $contract "Called to notify the gadget it is no longer visible on the screen. This should stop timers and threads, and release any resources used by the gadget." }
12 { $see-also graft* } ;
15 { $values { "gadget" gadget } }
16 { $description "Calls " { $link graft* } " on the gadget and all children." }
17 { $notes "This word should never be called directly." }
18 { $see-also graft* ungraft } ;
21 { $values { "gadget" gadget } }
22 { $description "If the gadget is grafted, calls " { $link ungraft* } " on the gadget and all children." }
23 { $notes "This word should never be called directly." }
24 { $see-also ungraft* graft } ;
27 { $values { "gadget" gadget } }
28 { $description "Removes the gadget from its parent. This will relayout the parent." }
29 { $notes "This may result in " { $link ungraft* } " being called on the gadget and its children, if the gadget's parent is visible on the screen." }
30 { $warning "Some gadget classes have their own words for removing children, for example " { $link grid-remove } ". Read the documentation for the class of the gadget's parent before using this word." } ;
33 { $values { "gadget" gadget } }
34 { $description "Removes all children from the gadget. This will relayout the gadget." }
35 { $notes "This may result in " { $link ungraft* } " being called on the children, if the gadget is visible on the screen." }
36 { $warning "Some gadget classes have their own words for adding children, for example " { $link grid-remove } ". Read the documentation for the gadget class before using this word." }
37 { $side-effects "gadget" } ;
40 { $values { "gadget" gadget } { "parent" gadget } }
41 { $description "Adds a child gadget to a parent. If the gadget is contained in another gadget, " { $link unparent } " is called on the gadget first. The parent will be relayout." }
42 { $notes "Adding a gadget to a parent may result in " { $link graft* } " being called on the children, if the parent is visible on the screen." }
43 { $warning "Some gadget classes have their own words for adding children, for example " { $link grid-add } " and " { $link add-incremental } ". Read the documentation for the gadget class before using this word." }
44 { $side-effects "parent" } ;
47 { $values { "seq" "a sequence of gadgets" } { "parent" gadget } }
48 { $description "Adds a sequence of gadgets to a parent. The parent will be relayout." }
49 { $notes "This may result in " { $link graft* } " being called on the children, if the parent is visible on the screen." }
50 { $warning "Some gadget classes have their own words for adding children, for example " { $link grid-add } " and " { $link add-incremental } ". Read the documentation for the gadget class before using this word." }
51 { $side-effects "parent" } ;
54 { $values { "gadget" gadget } }
55 { $description "Outputs a sequence of all parents of the gadget, with the first element being the gadget itself." } ;
58 { $values { "gadget" gadget } { "quot" "a quotation with stack effect " { $snippet "( gadget -- )" } } }
59 { $description "Applies the quotation to every parent of the gadget, starting from the gadget itself." } ;
62 { $values { "gadget" gadget } { "quot" "a quotation with stack effect " { $snippet "( gadget -- ? )" } } { "parent" gadget } }
63 { $description "Outputs the first parent of the gadget, starting from the gadget itself, for which the quotation outputs a true value, or " { $link f } " if the quotation outputs " { $link f } " for every parent." } ;
66 { $values { "gadget" gadget } { "loc" "a pair of integers" } }
67 { $description "Outputs the location of the gadget relative to the top-left corner of the world containing the gadget. This word does not output a useful value if the gadget is not grafted." } ;
70 { $values { "parent" gadget } { "child" gadget } { "?" "a boolean" } }
71 { $description "Tests if " { $snippet "child" } " is contained inside " { $snippet "parent" } "." } ;
73 HELP: focusable-child*
74 { $values { "gadget" gadget } { "child" gadget } }
75 { $description "Outputs the child of the gadget which would prefer to receive keyboard focus, or " { $link t } " if the gadget itself should receive focus." }
76 { $examples "For example, if your gadget consists of an " { $link editor } " together with an output area whose contents react to changes in editor contents, then the " { $link focusable-child* } " method for your gadget class should return the editor, so that when the gadget is displayed in a window or passed to " { $link request-focus } ", the editor receives keyboard focus automatically." } ;
79 { $values { "gadget" gadget } { "child" gadget } }
80 { $description "Outputs the child of the gadget which would prefer to receive keyboard focus." } ;
83 { $values { "children" "a sequence of gadgets" } { "pack" "a new " { $link pack } } }
84 { $description "Creates a new " { $link pack } " which lays out a sequence of gadgets vertically." } ;
86 HELP: make-filled-pile
87 { $values { "children" "a sequence of gadgets" } { "pack" "a new " { $link pack } } }
88 { $description "Creates a new " { $link pack } " which lays out a sequence of gadgets vertically, such that all gadgets have the same width." } ;
91 { $values { "children" "a sequence of gadgets" } { "pack" "a new " { $link pack } } }
92 { $description "Creates a new " { $link pack } " which lays out a sequence of gadgets horizontally." } ;