XRC problems

Here it is, btw, the message where this bug has been clearly mentioned:

=============================================================================

Subject: Re: [wxPython-users] wxPyTypeCast, FindWindowById, and
wxCalendarCtrl
From: *Robin Dunn*
Date: Thu, *23 Jan 2003* 10:11:40 -0800

...

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.

=============================================================================

And it was only 1 week ago... I guess, the fixed version will not be so
soon...

Uhh, what shall I do now? Make three controls instead of one? :frowning: Pity.

Just fix it by yourself in your script:

        from wxPython import wx
        wx.wxCalendarCtrlPtr = wxCalendarCtrlPtr
        self.calendar_ctrl = wxPyTypeCast(XRCCTRL(self.date_dialog,
                                                  "calendar_ctrl"),
                                          "wxCalendarCtrl")

This works for me.

Alberto

Alberto Griggio wrote:

Just fix it by yourself in your script:

        from wxPython import wx
        wx.wxCalendarCtrlPtr = wxCalendarCtrlPtr
        self.calendar_ctrl = wxPyTypeCast(XRCCTRL(self.date_dialog, "calendar_ctrl"),
                                          "wxCalendarCtrl")

Well, I did. It tells me this:

File "xrctest.py", line 11, in ?
     wx.wxCalendarCtrlPtr = wxCalendarCtrlPtr
NameError: name 'wxCalendarCtrlPtr' is not defined

When I make this:

  from wxPython.wx import *
  from wxPython.xrc import *
  from wxPython import calendar

  wxCalendarCtrlPtr = calendar.wxCalendarCtrlPtr

It says:

theClass = globals()[typeStr+"Ptr"]
KeyError: wxCalendarCtrlPtr

Sad, your method doesn't work for me too...

BTW, I use python 2.2.2. (wxPython is ver. 2.4)

···

--
Andrei Sosnin
http://zzx.dyn.ee

<!-- : it all depends on your vision : -->