bugfix - waiting for anyButtonPressede not
authorca
Wed, 20 Jun 2007 11:02:07 +0200
changeset 3233 50bec260bddc
parent 3232 877e0098f3b1
child 3234 53f4c03b615a
bugfix - waiting for anyButtonPressede not
MenuPanel.st
--- a/MenuPanel.st	Wed May 30 14:53:01 2007 +0200
+++ b/MenuPanel.st	Wed Jun 20 11:02:07 2007 +0200
@@ -3298,7 +3298,7 @@
 handleButtonPressAtPoint:aPoint
     "a button pressed; open or close the corresponding submenus"
 
-    | item sensor direction wasSelected|
+    | item direction wasSelected|
 
     item := self itemAtPoint:aPoint.
     item isNil ifTrue:[
@@ -3332,9 +3332,11 @@
     self invalidateItem:item repairNow:true.
     self acceptItem:item inMenu:self.
 
-    sensor := self sensor.
-    [sensor anyButtonPressed] whileTrue:[ Delay waitForSeconds:0.1 ].
-    sensor flushUserEvents.
+    [ (device notNil and:[device anyButtonPressed]) ] whileTrue:[
+        "/ using device - sensor is not updated sometimes
+        Delay waitForSeconds:0.1.
+    ].
+    self sensor flushUserEvents.
     self selection:nil.
 
     "Created: / 13.11.2001 / 14:12:04 / cg"
@@ -7871,7 +7873,7 @@
 !MenuPanel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.449 2007-03-30 14:39:29 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.450 2007-06-20 09:02:07 ca Exp $'
 ! !
 
 MenuPanel initialize!