Newbie question about events and event handling

Patrick J. Anderson pat.j.anderson at gmail.com
Thu Nov 1 17:27:28 PDT 2007


On Thu, 01 Nov 2007 16:42:13 -0700, Christopher Barker wrote:

> Patrick J. Anderson wrote:
>> I'm not sure how DayPlanner instance can catch the event originating in
>> from MiniCalendar instance and change the UI to reflect it.
> 
> You have two options:
> 
> 1) put a reference to the DayPlanner instance in your MiniCalendar, then
> call a method on it in your event handler. That's the easiest way,
> though maybe better to use the main frame or App object as an
> intermediary.
> 
> 2) Use a way to post an event indicating that the date has changed. You
> can either use custom wx event and wx.PostEvent to do that, or, even
> better, use a system like wx.lib.pubsub to pass events around your app.
> I think that's probably what you want.
> 
> -CHB

Thanks, Chris, I'll try that.

How would wx.lib.evtmgr.EventManager fit into this scenario?





More information about the wxpython-users mailing list