Call event handler method when panel is created

How do I do that? I have a class called MainFrame, which inherits from wx.Frame. Inside it, I create a panel, and I want to call method self.ShowAppointmentsForToday when the panel is created - tried the following:

self.Bind( wx.EVT_WINDOW_CREATE, self.ShowAppointmentsForToday, panel )

But this is not working. The appointments are not shown in the panel. How do I solve this problem? Thanks in advance!

Why not just call self.ShowAppointmentsForToday() immediately after creating the panel? This would presumeably be in the init of MainFrame.

···

On Fri, Jun 6, 2014 at 8:56 PM, fernando.karpinski@gmail.com wrote:

How do I do that? I have a class called MainFrame, which inherits from wx.Frame. Inside it, I create a panel, and I want to call method self.ShowAppointmentsForToday when the panel is created - tried the following:

self.Bind( wx.EVT_WINDOW_CREATE, self.ShowAppointmentsForToday, panel )

But this is not working. The appointments are not shown in the panel. How do I solve this problem? Thanks in advance!

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


Best Regards,
Michael Moriarity

Thanks, I'll try that!

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Call-event-handler-method-when-panel-is-created-tp5721232p5721235.html
Sent from the wxPython-users mailing list archive at Nabble.com.