Newbie question about events and event handling

Patrick J. Anderson pat.j.anderson at gmail.com
Fri Nov 2 07:52:59 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

I used the reference to DayPlanner (option1) in my MiniCalendar and I 
call a method setDate() on planner instance, but how do I update the 
widget, so it reflects the change?





More information about the wxpython-users mailing list