Menu cleanup

slava 2006-03-19 23:43:47 +00:00
parent ecdb67dc93
commit 1f6f21489c
1 changed files with 1 additions and 10 deletions

View File

@ -5,19 +5,10 @@ USING: gadgets gadgets-borders gadgets-buttons gadgets-layouts
gadgets-labels gadgets-theme generic kernel lists math
namespaces sequences ;
: retarget-drag ( gadget -- )
hand-gadget get-global hand-clicked get-global eq? [
drop
] [
hand-gadget get-global hand-clicked set-global
update-hand
] if ;
: retarget-click ( gadget -- )
find-world dup hide-glass update-hand update-clicked ;
: menu-actions ( glass -- )
! dup [ retarget-drag ] [ drag ] set-action
[ retarget-click ] [ button-down ] set-action ;
: menu-loc ( loc menu world -- loc )
@ -25,7 +16,7 @@ namespaces sequences ;
: show-menu ( loc menu gadget -- )
find-world 2dup show-glass
dup world-glass dup menu-actions hand-clicked set-global
dup world-glass menu-actions
over >r menu-loc r> set-rect-loc ;
: show-hand-menu ( menu gadget -- )