problem with wxPanel derivation class

kyosohma at gmail.com kyosohma at gmail.com
Fri Oct 12 15:32:49 CEST 2007


On Oct 11, 4:01 pm, "Chris Mellon" <arka... at gmail.com> wrote:
> On 10/11/07, <"@bag.python.org <"none> wrote:> wxGlade created a simple Frame with a panel a sizer and 3 wxControls ,
> > saticText, TextCtrl, and a Button.
>
> <snip>
>
> > It seems as though the complaint is that  a 'wxWindow *' is expected,
> > 'Panel' is received
> > However, Panel IS a wx.Panel derivative which IS a wx.Window derivative!
> > Additionally, the methods in the code of Panel and MyFrameOne seem to be
> > identical.
> > I can't understand this. Anyone have any thoughts?
>
> It's because you didn't call the base class __init__. wxPython is a
> SWIG wrapper around the C++ wxWidgets library, and if you don't call
> the base class the SWIG infrastructure that maps your class to an
> underlying C++ class doesn't happen and you get this error.

Ah-so. I knew there was a more technical answer than what I gave.
Hopefully I didn't muddy the issue with my doofy code.

Mike




More information about the Python-list mailing list