diff --git a/library/ui/gestures.factor b/library/ui/gestures.factor index 3c1403aaab..4592f9a4f5 100644 --- a/library/ui/gestures.factor +++ b/library/ui/gestures.factor @@ -26,8 +26,8 @@ USING: alien generic hashtables kernel lists math sequences ; #! gesture, otherwise returns f. [ dupd handle-gesture* ] each-parent nip ; -: user-input ( str gadget -- ? ) - [ dupd user-input* ] each-parent nip ; +: user-input ( str gadget -- ) + [ dupd user-input* ] each-parent 2drop ; ! Mouse gestures are lists where the first element is one of: SYMBOL: motion diff --git a/library/ui/hand.factor b/library/ui/hand.factor index bb132d98e7..3b42f4ebf0 100644 --- a/library/ui/hand.factor +++ b/library/ui/hand.factor @@ -128,8 +128,8 @@ V{ } clone hand-buttons set-global : ui-step ( -- ) do-timers - [ layout-queued ] make-hash - [ nip dup world-handle [ draw-world ] when ] hash-each + [ layout-queued ] make-hash hash-values + [ dup world-handle [ draw-world ] [ drop ] if ] each 10 sleep ; : close-world ( world -- ) diff --git a/library/ui/launchpad.factor b/library/ui/launchpad.factor index af2d7b2753..77678e2cc2 100644 --- a/library/ui/launchpad.factor +++ b/library/ui/launchpad.factor @@ -13,6 +13,8 @@ sequences ; { "Documentation" [ [ handbook ] in-browser ] } { "Tutorial" [ [ tutorial ] in-browser ] } { "Vocabularies" [ [ vocabs. ] in-browser ] } + { "Globals" [ [ global describe ] in-browser ] } + { "Memory" [ [ heap-stats. terpri room. ] in-browser ] } { "Save image" [ save ] } { "Exit" [ 0 exit ] } } ; diff --git a/library/ui/world.factor b/library/ui/world.factor index 72a3a12504..4a523fa7cf 100644 --- a/library/ui/world.factor +++ b/library/ui/world.factor @@ -50,4 +50,4 @@ M: world find-world ; world-focus parents reverse-slice ; : simple-window ( gadget title -- ) - >r f over pref-dim r> in-window ; + >r f over pref-dim { 800 800 0 } vmin r> in-window ; diff --git a/library/x11/ui.factor b/library/x11/ui.factor index 0b068a5c9e..bd77883bd3 100644 --- a/library/x11/ui.factor +++ b/library/x11/ui.factor @@ -72,9 +72,9 @@ M: world motion-event ( event world -- ) M: world key-down-event ( event world -- ) world-focus over event>gesture [ over handle-gesture - [ over lookup-string nip swap user-input ] [ 2drop ] if + [ swap lookup-string nip swap user-input ] [ 2drop ] if ] [ - drop + 2drop ] if* ; M: world key-up-event ( event world -- ) 2drop ; diff --git a/library/x11/utilities.factor b/library/x11/utilities.factor index 8d76590348..121bae6f40 100644 --- a/library/x11/utilities.factor +++ b/library/x11/utilities.factor @@ -26,9 +26,11 @@ SYMBOL: root dpy get XDefaultScreen scr set dpy get scr get XRootWindow root set ; +: close-x ( -- ) dpy get XCloseDisplay drop ; + : with-x ( display-string quot -- ) [ H{ } clone windows set swap initialize-x - call + [ close-x ] cleanup ] with-scope ;