]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/gadgets/incremental/incremental-docs.factor
Fix permission bits
[factor.git] / basis / ui / gadgets / incremental / incremental-docs.factor
1 USING: ui.gadgets help.markup help.syntax ui.gadgets.packs ;
2 IN: ui.gadgets.incremental
3
4 HELP: incremental
5 { $class-description "Incremental layout gadgets inherit from " { $link pack } " and implement an optimization where the relayout operation after adding a child to be done in constant time."
6 $nl
7 "Incremental layout gadgets are created by calling " { $link <incremental> } "."
8 $nl
9 "Children are managed with the " { $link add-incremental } " and " { $link clear-incremental } " words."
10 $nl
11 "Not every " { $link pack } " can use incremental layout, since incremental layout does not support non-default values for the " { $slot "align" } ", " { $slot "fill" } ", and " { $slot "gap" } " slots." } ;
12
13 HELP: <incremental>
14 { $values { "incremental" "a new instance of " { $link incremental } } }
15 { $description "Creates a new incremental layout gadget." } ;
16
17 { <incremental> add-incremental clear-incremental } related-words
18
19 HELP: add-incremental
20 { $values { "gadget" gadget } { "incremental" incremental } }
21 { $description "Adds the gadget to the incremental layout and performs relayout immediately in constant time." }
22 { $side-effects "incremental" } ;
23
24 HELP: clear-incremental
25 { $values { "incremental" incremental } }
26 { $description "Removes all gadgets from the incremental layout and performs relayout immediately in constant time." }
27 { $side-effects "incremental" } ;
28
29 ARTICLE: "ui-incremental-layout" "Incremental layouts"
30 "Incremental layout gadgets are like " { $link "ui-pack-layout" } " except the relayout operation after adding a new child can be done in constant time."
31 $nl
32 "With all layouts, relayout requests from consecutive additions and removals are of children are coalesced and result in only one relayout operation being performed, however the run time of the relayout operation itself depends on the number of children."
33 $nl
34 "Incremental layout is used by " { $link "ui.gadgets.panes" } " to ensure that new lines of output does not take longer to display when the pane already has previous output."
35 $nl
36 "Incremental layouts are not a general replacement for " { $link "ui-pack-layout" } " and there are some limitations to be aware of."
37 { $subsection incremental }
38 { $subsection <incremental> }
39 "Children are added and removed with a special set of words which perform necessary relayout immediately:"
40 { $subsection add-incremental }
41 { $subsection clear-incremental }
42 "Calling " { $link unparent } " to remove a child of an incremental layout is permitted, however the relayout following the removal will not be performed in constant time, because all gadgets following the removed gadget need to be moved." ;
43
44 ABOUT: "ui-incremental-layout"