wxPyTypeCast, FindWindowById, and wxCalendarCtrl

I’m probably missing something fundamental here, but the only way I can figure out how to get a wxCalendarCtrl to work from an XRC file is by doing a ‘from wxPython.calendar import *’ from within wx.py. Otherwise, XMLCTRL() will return a wxControlPtr and wxPyTypeCast() does not know what a ‘wxCalendarCtrl’ is since it uses the globals() call from within wx.py. Yet, I’ve seen examples in the archives of people using FindWindowById() to get a wxCalendarCtrl and then call its specific members.

What am I missing?

···

--
Matt Murphy

Matt Murphy wrote:

I’m probably missing something fundamental here, but the only way I can figure out how to get a wxCalendarCtrl to work from an XRC file is by doing a ‘from wxPython.calendar import *’ from within wx.py. Otherwise, XMLCTRL() will return a wxControlPtr and wxPyTypeCast() does not know what a ‘wxCalendarCtrl’ is since it uses the globals() call from within wx.py. Yet, I’ve seen examples in the archives of people using FindWindowById() to get a wxCalendarCtrl and then call its specific members.

What am I missing?

I'll add it to my todo list. A better fix would be to add

  import wx
  wx.wxCalendatCtrlPtr = wxCalendarCtrlPtr

to calendar.py. That way you don't have to import calendar all the time even if you don't use it.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!