[wxPython-users] Re: Re: custom events vs call backs

Werner F. Bruhin werner.bruhin at free.fr
Tue Nov 28 03:50:21 PST 2006


Hi Donn,

Donn Ingle wrote:

>>If you start with this model now then if/when the need for
>>more complete decoupling comes up in your app then it will be painless
>>to do it.
>>    
>>
>Thanks Robin. I'll keep that in mind. I fear my app is already too far gone
>for yet another new concept :) but your suggestion has attractions as I
>already have one object that needs to talk to a sibling and having to go:
>object --> parent --> sibling 
>is a real pain in the ass.
>  
>
I had similar issue that when I change the database for e.g. countries 
all the combobox's showing country needed to be notified, don't ask me 
how I originaly done it but it was ugly (also it worked somehow), 
another problem I had was how to write to the statusbar a message (the 
modul wanting to write had no idea who had the statusbar (was it the 
parent, the grand parent or some oncle?).

I then read about the pubsub stuff and frankly initialy thought this is 
probably overkill and/or to complicated for me.  But then I still looked 
at it and I can tell you it makes things a lot easier.

I then started to use pubsub first for new things were it made sense and 
only later went back and changed things.

I suggest to take a bit of time and look at it, I am pretty sure it will 
releave some of the pain ;-) .
Werner





More information about the wxpython-users mailing list