problem with wxPanel derivation class

Chris Mellon arkanes at
Thu Oct 11 23:01:54 CEST 2007

On 10/11/07, <" <"none> wrote:
> wxGlade created a simple Frame with a panel a sizer and 3 wxControls ,
> saticText, TextCtrl, and a Button.

> 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.

More information about the Python-list mailing list