1 ! Copyright (C) 2007, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors io kernel prettyprint ui ui.gadgets
4 ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.theme
8 TUPLE: gesture-logger < gadget stream ;
10 : <gesture-logger> ( stream -- gadget )
11 \ gesture-logger new-gadget
14 black solid-interior ;
16 M: gesture-logger handle-gesture
17 over T{ button-down } = [ dup request-focus ] when
18 stream>> [ . ] with-output-stream*
21 M: gesture-logger user-input*
23 "User input: " write print
24 ] with-output-stream* t ;
26 : gesture-logger ( -- )
28 <scrolling-pane> dup <scroller>
29 "Gesture log" open-window
30 <pane-stream> <gesture-logger>
31 "Gesture input" open-window