Receiving mouse move events from another window?

I'm sure this is really simple, but haven't found what I need. I want to have EVT_MOTION events from one window sent to another. For example, imagine an image viewer where a tool palette shows the x, y coordinates and RGB color of the pixel under the mouse in the main image window. The tool window needs to know when the mouse moves in the main window. Can I use Bind in the tool window to bind events in the main window? Or is there some other way?

--Ned.
http://nedbatchelder.com

You should be able to Bind the event in the main Frame and then use wx.lib.pubsub to send whatever information you need to to the other Frame.

http://www.wxpython.org/docs/api/wx.lib.pubsub.PublisherClass-class.html

···

On Mon, Jul 7, 2008 at 5:29 PM, Ned Batchelder ned@nedbatchelder.com wrote:

I’m sure this is really simple, but haven’t found what I need. I want to have EVT_MOTION events from one window sent to another. For example, imagine an image viewer where a tool palette shows the x, y coordinates and RGB color of the pixel under the mouse in the main image window. The tool window needs to know when the mouse moves in the main window. Can I use Bind in the tool window to bind events in the main window? Or is there some other way?

–Ned.

http://nedbatchelder.com


Stand Fast,
tjg.

Great. event.Skip() makes it work properly, so now the tool window and
the main window see the event. I’m wondering now about the proper
practice here. For modularity, should all event handlers call
event.Skip() at the end to ensure that other bound listeners have a
chance? In most cases, it’s unneeded, right? What’s the right thing
to do?

–Ned.

Tim van der Leeuw wrote:

···

wxpython-users@lists.wxwidgets.orghttp://lists.wxwidgets.org/mailman/listinfo/wxpython-users

-- Ned Batchelder,

http://nedbatchelder.com