[wxPython-users] reverse event handling?

Robin Dunn robin at alldunn.com
Fri Jun 1 15:19:15 PDT 2007


Eric Ongerth wrote:
> Hello,
> I've had good luck so far with the wxWidgets/wxPython event handling 
> framework.  Most of the time I'm using it as intended and it's really 
> helpful compared to what I remember dealing with in Motiv during my 
> previous run at GUI programming circa 1992.  

Been there, done that.  Same year too.

> Now some of these children happen to generate database inserts and, as a 
> result of these inserts, some of the text fields (and, as it happens, 
> TextCtrlAutoComplete controls) in children *on another branch of this 
> hierarchy* need to re-query the database in order to present themselves 
> in accordance with the UI i'm trying to present.

As Josiah mentioned pubsub is what you are looking for.  Then hierarchy 
doesn't matter at all, the target doesn't even have to be a widget.  You 
just have some part(s) of your program subscribe to a particular topic 
and have some other part(s) of your program publish messages with that 
topic.  All the plumbing is taken care of by pubsub.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list