! editor passes C+c, C+s, and so on to it's parent. All parents should ! pass them too. In world waits a gesture-handler. It handles keypresses ! for which action gestures exist. The corresponding action gesture is ! sent to editor. editor either handles the action gesture or passes it to ! it's parent. 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 ! gadget [ ] [ dup key-down? [ sym>> ] [ drop f ] if ] [ word? ] tri or [ .. ] [ drop ] if t ! as some gestures are handled by world ; : ( child -- border ) main-gadget new-border { 9 9 } >>size ; : main ( -- ) [ "Try copy and paste here, DELETE, UP, and C+s." over set-editor-string "" open-window ] with-ui ; MAIN: main