Missed clicks with generic buttons on Mac OS 10.5

Hi All,

I've just started developing with wxPython on a Mac (Leopard) -- it's very nice.

One thing I've just noticed is that the generic buttons in wxPython (e.g, GenButton, GenBitmapButton) do not seem to be as responsive to button clicks as the "native" button widgets (wx.Button, wx.BitmapButton). When I use GenButton and I click rapidly, the first click is acknowledged, but subsequent clicks are ignored (the button does not respond graphically and I do not receive the events). Furthermore, other widgets such as the TreeCtrl also "miss" clicks. When I used the native widgets, I do not miss any clicks.

It is this a known problem, or is there some workaround?

I don't see this behavior with generic buttons on Ubuntu 7.10.

Thanks,

Greg

Hello,

I have noticed the button issue as well. When looking at the source there is some conditional code for EVT_LEFT_DCLICK that is only set for windows. Removing this gets the clicking to be more responsive.

Index: wx/lib/buttons.py

···

===================================================================
--- wx/lib/buttons.py (revision 51203)
+++ wx/lib/buttons.py (working copy)
@@ -82,8 +82,7 @@

          self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
          self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
- if wx.Platform == '__WXMSW__':
- self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown)
+ self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown)
          self.Bind(wx.EVT_MOTION, self.OnMotion)
          self.Bind(wx.EVT_SET_FOCUS, self.OnGainFocus)
          self.Bind(wx.EVT_KILL_FOCUS, self.OnLoseFocus)

Regards,

Cody Precord

On Jan 14, 2008, at 12:24 AM, Greg Benson wrote:

Hi All,

I've just started developing with wxPython on a Mac (Leopard) -- it's very nice.

One thing I've just noticed is that the generic buttons in wxPython (e.g, GenButton, GenBitmapButton) do not seem to be as responsive to button clicks as the "native" button widgets (wx.Button, wx.BitmapButton). When I use GenButton and I click rapidly, the first click is acknowledged, but subsequent clicks are ignored (the button does not respond graphically and I do not receive the events). Furthermore, other widgets such as the TreeCtrl also "miss" clicks. When I used the native widgets, I do not miss any clicks.

It is this a known problem, or is there some workaround?

I don't see this behavior with generic buttons on Ubuntu 7.10.

Thanks,

Greg

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Thanks Cody!

This works for me. Furthermore, I made a similar change to wx/lib/buttonpanel.py (see below) makes the buttons in the button panel responsive. Perhaps this is a general issue of double click events being ignored in contexts where it should (or should be allowed to) only be interpreted as a mouse down event.

In System Preferences on my Mac, I adjusted my double click speed to the fastest setting. This makes clicking fast on the TreeCtrl and TreeListCtrl more responsive, but this is not the best solution.

Greg

*** buttonpanel.py 2008-01-14 06:21:20.000000000 -0800
--- buttonpanel-org.py 2008-01-14 06:20:40.000000000 -0800

···

***************
*** 1285,1291 ****
           self.Bind(wx.EVT_MOTION, self.OnMouseMove)
           self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
           self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
- self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown)
           self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave)
           self.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnterWindow)

--- 1285,1290 ----

On Jan 14, 2008, at 12:34 AM, Cody Precord wrote:

Hello,

I have noticed the button issue as well. When looking at the source there is some conditional code for EVT_LEFT_DCLICK that is only set for windows. Removing this gets the clicking to be more responsive.

Index: wx/lib/buttons.py

--- wx/lib/buttons.py (revision 51203)
+++ wx/lib/buttons.py (working copy)
@@ -82,8 +82,7 @@

        self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
        self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
- if wx.Platform == '__WXMSW__':
- self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown)
+ self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown)
        self.Bind(wx.EVT_MOTION, self.OnMotion)
        self.Bind(wx.EVT_SET_FOCUS, self.OnGainFocus)
        self.Bind(wx.EVT_KILL_FOCUS, self.OnLoseFocus)

Regards,

Cody Precord

On Jan 14, 2008, at 12:24 AM, Greg Benson wrote:

Hi All,

I've just started developing with wxPython on a Mac (Leopard) -- it's very nice.

One thing I've just noticed is that the generic buttons in wxPython (e.g, GenButton, GenBitmapButton) do not seem to be as responsive to button clicks as the "native" button widgets (wx.Button, wx.BitmapButton). When I use GenButton and I click rapidly, the first click is acknowledged, but subsequent clicks are ignored (the button does not respond graphically and I do not receive the events). Furthermore, other widgets such as the TreeCtrl also "miss" clicks. When I used the native widgets, I do not miss any clicks.

It is this a known problem, or is there some workaround?

I don't see this behavior with generic buttons on Ubuntu 7.10.

Thanks,

Greg

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Cody Precord wrote:

Hello,

I have noticed the button issue as well. When looking at the source there is some conditional code for EVT_LEFT_DCLICK that is only set for windows. Removing this gets the clicking to be more responsive.

Index: wx/lib/buttons.py

--- wx/lib/buttons.py (revision 51203)
+++ wx/lib/buttons.py (working copy)
@@ -82,8 +82,7 @@

         self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
         self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
- if wx.Platform == '__WXMSW__':
- self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown)
+ self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown)
         self.Bind(wx.EVT_MOTION, self.OnMotion)
         self.Bind(wx.EVT_SET_FOCUS, self.OnGainFocus)
         self.Bind(wx.EVT_KILL_FOCUS, self.OnLoseFocus)

Regards,

I don't remember why that was MSW only and I don't see any reason why it should be now, so I'll make the change. Thanks.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!