From c4c829aeab7444df1374a0c93637eb1a2c0724d1 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 18 Feb 2000 21:21:04 +0000 Subject: [PATCH] toggle button doesn't send event if mouse is released outside of the button. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- utils/wxPython/lib/buttons.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/wxPython/lib/buttons.py b/utils/wxPython/lib/buttons.py index e02f28850e..7d63710314 100644 --- a/utils/wxPython/lib/buttons.py +++ b/utils/wxPython/lib/buttons.py @@ -381,6 +381,7 @@ class __ToggleMixin: def OnLeftDown(self, event): if not self.IsEnabled(): return + self.saveUp = self.up self.up = not self.up self.CaptureMouse() self.SetFocus() @@ -389,7 +390,8 @@ class __ToggleMixin: def OnLeftUp(self, event): if not self.IsEnabled(): return - self.Notify() + if self.up != self.saveUp: + self.Notify() self.ReleaseMouse() self.Refresh() -- 2.45.2