[wxPython-users] Re: Newbie question about events and event handling

Christopher Barker Chris.Barker at noaa.gov
Thu Nov 1 16:42:13 PDT 2007


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


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list