]> gitweb.factorcode.org Git - factor.git/blob - core/ui/gadgets/panes.facts
b574a8274e7ace93ceb37b1a4dc6757848458f3a
[factor.git] / core / ui / gadgets / panes.facts
1 IN: gadgets-panes
2 USING: gadgets models help io kernel ;
3
4 HELP: pane
5 { $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> } ", " { $link <scrolling-pane> } " or " { $link <pane-control> } "." }
6 { $see-also with-pane make-pane write-gadget print-gadget } ;
7
8 HELP: <pane>
9 { $values { "pane" "a new " { $link pane } } }
10 { $description "Creates a new " { $link pane } " gadget." }
11 { $see-also <scrolling-pane> <pane-control> make-pane } ;
12
13 HELP: pane-stream
14 { $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> } "." }
15 { $see-also <pane> make-pane with-pane } ;
16
17 HELP: <pane-stream> ( pane -- stream )
18 { $values { "pane" pane } { "stream" "a new " { $link pane-stream } } }
19 { $description "Creates a new " { $link pane-stream } " for writing to " { $snippet "pane" } "." }
20 { $see-also <pane> make-pane with-pane } ;
21
22 HELP: write-gadget
23 { $values { "gadget" gadget } { "stream" "an output stream" } }
24 { $contract "Writes a gadget to the stream." }
25 { $notes "Not all streams support this operation." }
26 { $see-also pane-stream print-gadget gadget. } ;
27
28 HELP: print-gadget
29 { $values { "gadget" gadget } { "stream" "an output stream" } }
30 { $description "Writes a gadget to the stream, followed by a newline." }
31 { $notes "Not all streams support this operation." }
32 { $see-also pane-stream write-gadget gadget. } ;
33
34 HELP: gadget.
35 { $values { "gadget" gadget } { "stream" "an output stream" } }
36 { $description "Writes a gadget followed by a newline to the " { $link stdio } " stream." }
37 { $notes "Not all streams support this operation." }
38 { $see-also pane-stream write-gadget print-gadget } ;
39
40 HELP: ?terpri
41 { $values { "stream" pane-stream } }
42 { $description "Inserts a line break in the pane unless the current line is empty." } ;
43
44 HELP: with-pane
45 { $values { "pane" pane } { "quot" quotation } }
46 { $description "Clears the pane and calls the quotation in a new scope where " { $link stdio } " is rebound to a " { $link pane-stream } " writing to the pane." }
47 { $see-also make-pane } ;
48
49 HELP: make-pane
50 { $values { "quot" quotation } { "pane" "a new " { $link pane } } }
51 { $description "Calls the quotation in a new scope where " { $link stdio } " is rebound to a " { $link pane-stream } " writing to a new pane. The pane is output on the stack after the quotation returns." }
52 { $see-also with-pane } ;
53
54 HELP: <scrolling-pane>
55 { $values { "pane" "a new " { $link pane } } }
56 { $description "Creates a new " { $link pane } " gadget which scrolls any scroll pane containing it to the bottom on output. behaving much like a terminal or logger." }
57 { $see-also <pane> <pane-control> } ;
58
59 HELP: <pane-control>
60 { $values { "model" model } { "quot" "a quotation with stack effect " { $snippet "( value -- )" } } { "pane" "a new " { $link pane } } }
61 { $description "Creates a new " { $link 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 } "." }
62 { $see-also <pane> <scrolling-pane> } ;