Paste: editor and action gestures
Author: | Georg Simon |
Mode: | factor |
Date: | Mon, 24 Aug 2015 10:09:02 |
Plain Text |
USING:
accessors io kernel prettyprint
ui ui.gadgets.borders ui.gadgets.editors ui.gestures words
;
IN: editor-gestures
: .. ( obj -- )
. flush
;
TUPLE: main-gadget < border
;
M: main-gadget handle-gesture ( gesture gadget -- ? )
drop
[ ]
[ dup key-down? [ sym>> ] [ drop f ] if ]
[ word? ]
tri
or [ .. ] [ drop ] if
t
;
: <main-gadget> ( child -- border )
main-gadget new-border { 9 9 } >>size
;
: main ( -- )
[ <editor>
"Try copy and paste here, DELETE, UP, and C+s."
over set-editor-string
<main-gadget> "" open-window
]
with-ui
;
MAIN: main
New Annotation