Difference? EVT_MOTION verse EVT_SET_CURSOR

“”"
What is the difference between wx.EVT_SET_CURSOR and wx.EVT_MOTION?
On my system each event gets fired when I move the mouse around the widget bound to both events.
“”"

if name == “main”:
import time
time.clock()
import wx

def onSetCursor(event):
    global textctrl
    textctrl.AppendText('%0.6f    onSetCursor()\n' % time.clock() )

def onMouseMotion(event):
    global textctrl
    textctrl.AppendText('%0.6f    onMouseMove()\n\n' % time.clock() )

app = wx.App()
frame = wx.Frame(None, title='Test EVT_SET_CURSOR and EVT_MOTION')
textctrl = wx.TextCtrl(frame, style=wx.TE_MULTILINE)
textctrl.Bind(wx.EVT_SET_CURSOR, onSetCursor, textctrl)
textctrl.Bind(wx.EVT_MOTION, onMouseMotion, textctrl)
frame.Show()
app.MainLoop()

``

No discovery to date.

You made my day!!

I was looking for a way to receive the mouse location in my DataViewController - while EVT_MOUSE_EVENTS, EVT_MOTION and a lot of other stuff is eaten by the DataViewCtrl, EVT_SET_CURSOR is not.

So at least there is a small difference, allthough if you are not using a control which masks the EVT_MOTION event, you might not see a difference at all.

Michael

Interesting.