How to merge 2 events logically, such as "wx.EVT_MOUSEWHEEL and not wx.EVT_SCROLLWIN"?

I try to create a functionality when user scrolls the view with mousewheel, for that function I use wx.EVT_MOUSEWHEEL event. But the mousewheel action also triggers wx.EVT_SCROLLWIN. That’s not what I want, because wx.EVT_SCROLLWIN triggers another function. That is:

wx.EVT_MOUSEWHEEL will trigger function A
wx.EVT_SCROLLWIN will trigger function B
But, wx.EVT_MOUSEWHEEL should not trigger function B

can I do something like

my_event = wx.EVT_MOUSEWHEEL and not wx.EVT_SCROLLWIN
self.my_panel.grid.Bind(my_event self.onScrollWin)

it doesn’t work, obviously. But is there a work around?

I hope you understand what I wanted to tell

Ok, so this is my understanding and may not be 100% but might
clarify things a bit:
In general events are separate items in a queue so you cannot do
things like anding them as you illustrated above because when the
first being processed the second, (if it exists in this case), is
still in the queue, possibly not even next in the queue if there has
been a lot going on and it is also not guaranteed that the order is
fixed in some cases.
The good news in this case is that IIRC the fact that you are
pragmatically scrolling the window in response to the mouse wheel
actually causes the wx.EVT_SCROLLWIN event to happen so it will
always happen later, but not necessarily next, (other events may
have reached the queue in the mean time. There are a couple of ways of dealing with this:
1/ Only do the processing that needs to be different in the mouse
wheel event handler and let the things that normally happen when
scrolling come from the other hander - this is usually best - or
2/ Set a flag in your mouse wheel event handler and in your
scrolled event handler check and clear it but take no other action
if it was set.
Hope that is some help.
Gadget/Steve

···

On 03/01/15 13:12, steve wrote:

    I try to create a functionality when user scrolls

the view with mousewheel, for that function I use
wx.EVT_MOUSEWHEEL event. But the mousewheel action also triggers
wx.EVT_SCROLLWIN. That’s not what I want, because
wx.EVT_SCROLLWIN triggers another function. That is:

    wx.EVT_MOUSEWHEEL will trigger function A

    wx.EVT_SCROLLWIN will trigger function B

    But, wx.EVT_MOUSEWHEEL should not trigger function B



    can I do something like



              my_event =

wx.EVT_MOUSEWHEEL and not wx.EVT_SCROLLWIN

      self.my_panel.grid.Bind(my_event self.onScrollWin)



    it doesn't work, obviously. But is there a work around?



    I hope you understand what I wanted to tell

  You received this message because you are subscribed to the Google

Groups “wxPython-users” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to wxpython-users+unsubscribe@googlegroups.com.

  For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).