What is the preferred way to write some text to a gadget?
By trial and error I found this to work :
-----------------------------------------------------
IN: scratchpad USING: io.styles ui.gadgets.panes ;

CONSTANT: character-style
{ { font-name "sans-serif" } { font-size 22 } }
CONSTANT: paragraph-style
{ { wrap-margin 300 } }

<pane>
"sans-serif minimum space for each letter"
over <pane-stream>
[
    paragraph-style
    [ character-style [ print ] with-style ]
    with-nesting
    ]
with-output-stream
gadget.
-----------------------------------------------------
Is there a better way?

------------------------------------------------------------------------------
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to