]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/gadgets/panes/panes-docs.factor
docs: change $subsection to $subsections
[factor.git] / basis / ui / gadgets / panes / panes-docs.factor
1 USING: ui.gadgets models help.markup help.syntax io kernel
2 quotations ;
3 IN: ui.gadgets.panes
4
5 HELP: pane
6 { $class-description "A pane " { $link gadget } " displays formatted text which is written to a " { $link pane-stream } " targetting the pane. Panes are created by calling " { $link <pane> } " or " { $link <pane-control> } "." } ;
7
8 HELP: <pane>
9 { $values { "pane" "a new " { $link pane } } }
10 { $description "Creates a new " { $link pane } " gadget." } ;
11
12 HELP: write-gadget
13 { $values { "gadget" gadget } { "stream" "an output stream" } }
14 { $contract "Writes a gadget to the stream." }
15 { $notes "Not all streams support this operation." } ;
16
17 { write-gadget print-gadget gadget. } related-words
18
19 HELP: print-gadget
20 { $values { "gadget" gadget } { "stream" "an output stream" } }
21 { $description "Writes a gadget to the stream, followed by a newline." }
22 { $notes "Not all streams support this operation." } ;
23
24 HELP: gadget.
25 { $values { "gadget" gadget } }
26 { $description "Writes a gadget followed by a newline to " { $link output-stream } "." }
27 { $notes "Not all streams support this operation." } ;
28
29 HELP: with-pane
30 { $values { "pane" pane } { "quot" quotation } }
31 { $description "Clears the pane and calls the quotation in a new scope where " { $link output-stream } " is rebound to a " { $link pane-stream } " writing to the pane." } ;
32
33 HELP: make-pane
34 { $values { "quot" quotation } { "gadget" "a new " { $link gadget } } }
35 { $description "Calls the quotation in a new scope where " { $link output-stream } " is rebound to a " { $link pane-stream } " writing to a new pane. The output area of the new pane is output on the stack after the quotation returns. The pane itself is not output." } ;
36
37 HELP: <pane-control>
38 { $values { "model" model } { "quot" { $quotation "( value -- )" } } { "pane" "a new " { $link pane } } }
39 { $description "Creates a new control delegating to a " { $link pane } ". When the value of the model changes, the value is pushed on the stack and the quotation is called using " { $link with-pane } "." } ;
40
41 HELP: pane-stream
42 { $class-description "Pane streams implement the portion of the " { $link "stream-protocol" } " responsible for output of text, including full support for " { $link "styles" } ". Pane streams also support direct output of gadgets via " { $link write-gadget } " and " { $link print-gadget } ". Pane streams are created by calling " { $link <pane-stream> } "." } ;
43
44 HELP: <pane-stream>
45 { $values { "pane" pane } { "pane-stream" "a new " { $link pane-stream } } }
46 { $description "Creates a new " { $link pane-stream } " for writing to " { $snippet "pane" } "." } ;
47
48 { with-pane make-pane } related-words
49
50 ARTICLE: "ui.gadgets.panes" "Pane gadgets"
51 "The " { $vocab-link "ui.gadgets.panes" } " vocabulary implements panes, which display formatted text."
52 { $subsections
53     pane
54     <pane>
55     <pane-control>
56 }
57 "Panes are written to by creating a special output stream:"
58 { $subsections
59     pane-stream
60     <pane-stream>
61 }
62 "In addition to the stream output words (" { $link "stream-protocol" } ", pane streams can have gadgets written to them:"
63 { $subsections
64     write-gadget
65     print-gadget
66     gadget.
67 }
68 "The " { $link gadget. } " word is useful for interactive debugging of gadgets in the listener."
69 $nl
70 "There are a few combinators for working with panes:"
71 { $subsections
72     with-pane
73     make-pane
74 } ;
75
76 ABOUT: "ui.gadgets.panes"