]> gitweb.factorcode.org Git - factor.git/blobdiff - library/ui/gestures.factor
Menus
[factor.git] / library / ui / gestures.factor
index a0c8651d920d8f28a221970a5f2c6f9886da92dc..2f8f9aa4146f5878268b4a99fd7b7f13a8f24f1c 100644 (file)
@@ -146,16 +146,19 @@ V{ } clone hand-buttons set-global
     #! the current gadget, with all parents in between.
     hand-gadget get-global parents <reversed> ;
 
+: update-clicked ( -- )
+    hand-gadget get-global hand-clicked set-global
+    hand-loc get-global hand-click-loc set-global ;
+
+SYMBOL: menu-mode?
+
 : move-hand ( loc world -- )
     dup hand-world set-global
     under-hand >r over hand-loc set-global
     pick-up hand-gadget set-global
+    menu-mode? get-global [ update-clicked ] when
     under-hand r> hand-gestures ;
 
-: update-clicked ( -- )
-    hand-gadget get-global hand-clicked set-global
-    hand-loc get-global hand-click-loc set-global ;
-
 : send-button-down ( gesture loc world -- )
     move-hand
     update-clicked