Paste: Why does editor pass some handled gestures?
Author: | Georg Simon |
Mode: | factor |
Date: | Tue, 18 Aug 2015 05:28:58 |
Plain Text |
USING:
accessors io kernel sequences
ui ui.gadgets.borders ui.gadgets.editors ui.gestures
;
IN: editor-gestures
TUPLE: main-gadget < border
;
M: main-gadget handle-gesture ( gesture gadget -- ? )
drop gesture>string [ print flush ] when*
t
;
M: main-gadget handles-gesture? ( gesture gadget -- ? )
2drop t
;
: <main-gadget> ( child gap -- border )
[ main-gadget new-border ] dip >>size
;
: main ( -- )
[ <editor>
"Why does editor pass some gestures like 'C+c' or 'C+v'"
"on to it's parent although they were handled ?"
"\n" glue over set-editor-string
{ 9 9 } <main-gadget> "" open-window
]
with-ui
;
MAIN: main
Author: | Georg Simon |
Mode: | factor |
Date: | Wed, 19 Aug 2015 12:09:37 |
Plain Text |
USING:
accessors io kernel prettyprint
ui ui.gadgets.borders ui.gadgets.editors ui.gestures
;
IN: editor-gestures
TUPLE: main-gadget < border
;
M: main-gadget handle-gesture ( gesture gadget -- ? )
drop
dup key-down? [
dup T{ key-down } = [
drop
] [
. flush
] if
] [
drop
] if
t
;
M: main-gadget handles-gesture? ( gesture gadget -- ? )
2drop t
;
: <main-gadget> ( child gap -- border )
[ main-gadget new-border ] dip >>size
;
: main ( -- )
[ <editor>
"Try copy and paste here, DELETE, and UP."
over set-editor-string
{ 9 9 } <main-gadget> "" open-window
]
with-ui
;
MAIN: main
New Annotation