[ wxwindows-Bugs-1693273 ] Slider mouse events on OS X

SourceForge.net noreply at sourceforge.net
Mon Apr 2 21:22:06 PDT 2007


Bugs item #1693273, was opened at 2007-04-03 01:01
Message generated for change (Comment added) made by csomor
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1693273&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMac specific
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ed Leafe (msborg)
Assigned to: Stefan Csomor (csomor)
Summary: Slider mouse events on OS X

Initial Comment:
I've noticed that when using a slider on OS X, the EVT_LEFT_UP never gets triggered when the mouse is over the thumb control. However, if you click within the rectangular area of the control, but not along the slider "slot" (i.e., click on the control where it won't affect the thumb control), the event is triggered.

I've created a simple program that demonstrates this problem. I see both the down and up events on Windows, but on OS X, only the down events.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
import wx

class TestFrame(wx.Frame):
       def __init__(self, parent, id):
               super(TestFrame, self).__init__(parent=parent, id=id)
               self.SetSize((300, 400))
               pnl = wx.Panel(self)

               self.slider = wx.Slider(pnl)
               self.slider.SetPosition((50, 50))
               self.slider.Bind(wx.EVT_LEFT_DOWN, self.onSliderLeftDown)
               self.slider.Bind(wx.EVT_LEFT_UP, self.onSliderLeftUp)

       def onSliderLeftDown(self, evt):
               print "SLIDER LEFT DOWN"
               evt.Skip()

       def onSliderLeftUp(self, evt):
               print "SLIDER LEFT UP"
               evt.Skip()

if __name__ == '__main__':
       app = wx.PySimpleApp()
       frm = TestFrame(None, -1)
       frm.Show()
       app.MainLoop()

----------------------------------------------------------------------

>Comment By: Stefan Csomor (csomor)
Date: 2007-04-03 06:22

Message:
Logged In: YES 
user_id=81467
Originator: NO

Hi

yes, on OS X the mouse up event when dragging always belongs to the
control and is not exposed, you always should try to catch the
highest-level event exposed by a control, in the case of a slider you have
always two events that are triggered, first the group of scroll events
depending what happened, and then a command event
(wxEVT_COMMAND_SLIDER_UPDATED) that matches wx.EVT_SLIDER for wxPython
informing you that the value changed.

Best,

Stefan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1693273&group_id=9863




More information about the wx-dev mailing list