[wxPython-mac] display a result of an event in another frame

NOTE: this is on the wxpython-mac list, but you should post questions like this on the main wxPython-users list, as it is not Mac-specific, and a LOT more folks will read it there. I've cc-d that list on this note.

My question is that I am displaying 3 simultaneous frames which I am
calling from one main wx.App.

In one of the frames, I will invoke an event (on mouse click)which
will do a simple calculation like finding the pixel location and then
I want this information to be displayed in another frame.

I have no problem displaying this information in the original frame
where the event was called but I don't know how to display this result
in another frame.

You need some way to pass messages around between your frames. The simplest way to put a method somewhere that knows about all your frames -- the App object, for instance. Then you simply call that method when you want something done.

I've enclosed an example of that.

If you've got a lot of messaging, it would probably better to use a messaging system like pubsub:

A version of it is included with wx:

wx.lib.pubsub

-Chris

MultiFrame.py (1.58 KB)

ยทยทยท

On 11/19/10 7:08 AM, jj jones wrote:

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov