“”"
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()
``