[wxPython] NameError: wxSizerPtr

Related to my earlier posting (automatic
resizing of a whole tree of panels and
controls?) I had the idea to use GetSizer().
It is defined here:

./include/wx/window.h: wxSizer *GetSizer() const { return m_windowSizer; }

Unfortunately, wxPython gives me the following
traceback:

Traceback (innermost last):
  File "wxtask.py", line 272, in ?
    main(sys.argv)
  File "wxtask.py", line 268, in main
    app = MyApp(task)
  File "wxtask.py", line 251, in __init__
    wxApp.__init__(self, 0)
  File "/net/cci/paul/alpha/local/lib/python1.5/site-packages/wxPython/wx.py", l
ine 1625, in __init__
    _wxStart(self.OnInit)
  File "wxtask.py", line 254, in OnInit
    MyFrame(self.task)
  File "wxtask.py", line 230, in __init__
    tp = wxTaskParameters(self.frame, self.task.get_parameters())
  File "wxtask.py", line 25, in __init__
    self.Redraw()
  File "wxtask.py", line 58, in Redraw
    self.wxparam(self, self.panel, self.panel_sizer)
  File "wxtask.py", line 98, in wxparam
    dummy = gbox.GetSizer()
  File "/net/cci/paul/alpha/local/lib/python1.5/site-packages/wxPython/windows.p
y", line 486, in GetSizer
    if val: val = wxSizerPtr(val)
NameError: wxSizerPtr

Is this something that could be fixed?
Is there a work-around for the meantime?

Thanks!
        Ralf

--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.

Is this something that could be fixed?

Yes.

Is there a work-around for the meantime?

In windows.py change GetSizer to look like this:

    def GetSizer(self, *_args, **_kwargs):
        from sizers import wxSizerPtr
        val = apply(windowsc.wxWindow_GetSizer,(self,) + _args, _kwargs)
        if val: val = wxSizerPtr(val)
        return val

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxpython.org Java give you jitters?
http://wxpros.com Relax with wxPython!