Sending an event to "sister" windows

Hello,

I have a mainFrame which can display several customed windows representing the same data. Some action of the user in one of these windows should update all of these "sistser windows".

I tried to send a custom event which works but does not call binded functions of the sisters windows. I read again the event chapter on "wxPython in action" and I understood that events are propagate from widgets to containers. Because my sisters windows are not containers of the one which generates the event, they never intercept my custom event.

Does my understanding correct ?

During my tests, I found that I can send an event to a known widgets. With this, my main window can intercept my first customed event and send it again on my list of windows (by indicating a specific destination to events). This works but not really nice.

Is there a more wx-event method ?

Sebastien

···

--
Sébastien VINOT
sebastien.vinot@prevention-informatique.fr
Tel: +33 (1) 48 54 03 42
Mobile : + 33 (6) 86 71 77 35

I think what you want is pubsub. It allows you to set up multiple subscribers that can be published to. Here’s a simple tutorial: http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/

  • Mike

This looks exactly what I was looking for.

thanks a lot Mike

···

Le 14 juil. 2011 à 17:26, Mike Driscoll a écrit :

I think what you want is pubsub. It allows you to set up multiple subscribers that can be published to. Here’s a simple tutorial: http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/

  • Mike

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

Sébastien VINOT

sebastien.vinot@prevention-informatique.fr

Tel: +33 (1) 48 54 03 42

Mobile : + 33 (6) 86 71 77 35