]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't send the button event in idle time, just release the mouse first.
authorRobin Dunn <robin@alldunn.com>
Thu, 6 Dec 2001 20:00:27 +0000 (20:00 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 6 Dec 2001 20:00:27 +0000 (20:00 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/wxPython/lib/buttons.py

index 15d1c1328829df45804bd978c4fc85b500a6b470..7e9aaa2aeb7217c8089adb56baed0423fd368569 100644 (file)
@@ -67,7 +67,6 @@ class wxGenButton(wxControl):
         self.bezelWidth = 2
         self.hasFocus = false
         self.useFocusInd = true
-        self.evtToSend = []
 
         self.SetLabel(label)
         self.SetPosition(pos)
@@ -87,7 +86,6 @@ class wxGenButton(wxControl):
         EVT_KEY_UP(self,           self.OnKeyUp)
         EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
         EVT_PAINT(self,            self.OnPaint)
-        EVT_IDLE(self,             self.OnIdle)
 
 
     def SetBestSize(self, size=None):
@@ -176,14 +174,7 @@ class wxGenButton(wxControl):
         evt = wxGenButtonEvent(wxEVT_COMMAND_BUTTON_CLICKED, self.GetId())
         evt.SetIsDown(not self.up)
         evt.SetButtonObj(self)
-        self.evtToSend.append(evt)
-
-
-    def OnIdle(self, evt):
-        while self.evtToSend:
-            evt = self.evtToSend[0]
-            del self.evtToSend[0]
-            self.GetEventHandler().ProcessEvent(evt)
+        self.GetEventHandler().ProcessEvent(evt)
 
 
     def DrawBezel(self, dc, x1, y1, x2, y2):
@@ -263,10 +254,10 @@ class wxGenButton(wxControl):
     def OnLeftUp(self, event):
         if not self.IsEnabled():
             return
+        self.ReleaseMouse()
         if not self.up:    # if the button was down when the mouse was released...
             self.Notify()
         self.up = true
-        self.ReleaseMouse()
         self.Refresh()
         event.Skip()