user2939055
user2939055

Reputation: 167

in method 'new_panel' expected argument 1 of type wxWindow*

I have a class A (wx.Panel) which I believe is its parent class and this panel has been created using automatically generated wxGlade code and it has the init as

wx.Panel.__init__(self, *args, **kwds)

now Class B inherits class A. Class B(class A) and the init for class B is

def __init__(self, *args, **kw):
    A.__init__(self, *args, **kw)

When I try to create an object of class B, how should i instantiate it?

obj = B(). I know I cannot have a None because a parent is definitely needed. Why do I land in the error "in method 'new_panel' expected argument 1 of type wxWindow*"

-B

Upvotes: 0

Views: 1887

Answers (1)

Joran Beasley
Joran Beasley

Reputation: 113998

just like you would instantiate a wxPanel

f=wx.Frame(None,-1,"Some Frame")
b = B(f,-1) 
f.Show()

Upvotes: 1

Related Questions