IN: gadgets-panes USING: gadgets models help io kernel ; HELP: pane { $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 } ", " { $link } " or " { $link } "." } { $see-also with-pane make-pane write-gadget print-gadget } ; HELP: { $values { "pane" "a new " { $link pane } } } { $description "Creates a new " { $link pane } " gadget." } { $see-also make-pane } ; HELP: pane-stream { $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 } "." } { $see-also make-pane with-pane } ; HELP: ( pane -- stream ) { $values { "pane" pane } { "stream" "a new " { $link pane-stream } } } { $description "Creates a new " { $link pane-stream } " for writing to " { $snippet "pane" } "." } { $see-also make-pane with-pane } ; HELP: write-gadget { $values { "gadget" gadget } { "stream" "an output stream" } } { $contract "Writes a gadget to the stream." } { $notes "Not all streams support this operation." } { $see-also pane-stream print-gadget gadget. } ; HELP: print-gadget { $values { "gadget" gadget } { "stream" "an output stream" } } { $description "Writes a gadget to the stream, followed by a newline." } { $notes "Not all streams support this operation." } { $see-also pane-stream write-gadget gadget. } ; HELP: gadget. { $values { "gadget" gadget } } { $description "Writes a gadget followed by a newline to the " { $link stdio } " stream." } { $notes "Not all streams support this operation." } { $see-also pane-stream write-gadget print-gadget } ; HELP: ?terpri { $values { "stream" pane-stream } } { $description "Inserts a line break in the pane unless the current line is empty." } ; HELP: with-pane { $values { "pane" pane } { "quot" quotation } } { $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." } { $see-also make-pane } ; HELP: make-pane { $values { "quot" quotation } { "pane" "a new " { $link pane } } } { $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." } { $see-also with-pane } ; HELP: { $values { "pane" "a new " { $link pane } } } { $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." } { $see-also } ; HELP: { $values { "model" model } { "quot" "a quotation with stack effect " { $snippet "( value -- )" } } { "pane" "a new " { $link pane } } } { $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 } "." } { $see-also } ;