No wx.EVT_MOTION on html2.WebView?

So let’s say I have the following snippet of code:

view = wx.html2.WebView.New(parent)
def on_motion(e): print “motion”
view.Bind(wx.EVT_MOTION, on_motion)

If I then run that (with the appropriate initialization code, etc, and parent being a wx.Panel) and hover my mouse over the WebView, it doesn’t print anything out.

Is this a bug, or am I dong it wrong?

···

Griffin Smith wrote:

So let's say I have the following snippet of code:

view = wx.html2.WebView.New(parent)
def on_motion(e): print "motion"
view.Bind(wx.EVT_MOTION, on_motion)

If I then run that (with the appropriate initialization code, etc, and
parent being a wx.Panel) and hover my mouse over the WebView, it doesn't
print anything out.

Is this a bug, or am I dong it wrong?

It may be a bug, but there may not be anything we can do about it. Since the WebView is coming from another library we can't even be sure that the view object in the code above is the same one that you are seeing on the screen, it may actually be a [grand]child window. Either way it is possible that the native html rendering window is consuming all the mouse events for itself in a way that they can't be caught by wx.

You can try creating a ticket for this at trac.wxwidgets.org, that will at least get it seen by the WebView authors who might have some other way to accomplish this that I'm not thinking of at the moment.

···

--
Robin Dunn
Software Craftsman