Handbook Glossary
factorcode.org
gadget-selection ( gadget -- string/f )
Factor handbook » UI framework » Building user interfaces » Pre-made UI gadgets » Editor gadgets » The caret and mark

Prev:gadget-selection? ( gadget -- ? )
Next:remove-selection ( editor -- )


Vocabulary
ui.gadgets

Inputs
gadgeta gadget


Outputs
string/fa string or f


Generic word contract
Outputs the gadget's text selection, or f if nothing is selected.

Definition
IN: ui.gadgets

GENERIC: gadget-selection ( gadget -- string/f )


Methods
USING: accessors documents kernel ui.gadgets ui.gadgets.editors
ui.gadgets.editors.private ;

M: editor gadget-selection
[ selection-start/end ] [ model>> ] bi doc-range ;


USING: kernel ui.gadgets ;

M: gadget gadget-selection drop f ;


USING: ui.gadgets ui.gadgets.panes ui.gadgets.panes.private ;

M: pane gadget-selection selected-subtree gadget-text ;