Make focusable-child* work even if world has no children, to clean up a code duplication

Slava Pestov 2009-05-11 17:04:32 -05:00
parent 379ba2d777
commit 1f9fa090a3
3 changed files with 1 additions and 6 deletions

View File

@ -101,7 +101,7 @@ M: world layout*
[ call-next-method ] [ call-next-method ]
[ dup layers>> [ as-big-as-possible ] with each ] bi ; [ dup layers>> [ as-big-as-possible ] with each ] bi ;
M: world focusable-child* gadget-child ; M: world focusable-child* children>> [ t ] [ first ] if-empty ;
M: world children-on nip children>> ; M: world children-on nip children>> ;

View File

@ -21,5 +21,3 @@ M: game-world end-world
[ [ stop-loop ] when* f ] change-game-loop [ [ stop-loop ] when* f ] change-game-loop
drop ; drop ;
M: game-world focusable-child* drop t ;

View File

@ -36,9 +36,6 @@ M: demo-world distance-step ( gadget -- dz )
: zoom-demo-world ( distance gadget -- ) : zoom-demo-world ( distance gadget -- )
[ + ] with change-distance relayout-1 ; [ + ] with change-distance relayout-1 ;
M: demo-world focusable-child* ( world -- gadget )
drop t ;
M: demo-world pref-dim* ( gadget -- dim ) M: demo-world pref-dim* ( gadget -- dim )
drop { 640 480 } ; drop { 640 480 } ;