- 论坛徽章:
- 0
|
我想写一个继承Tkinter里Entry的类,在这个类构造时调用另外一个实例的方法,同时,由于需要,我还要用回Entry类的构造函数,我该怎么写呢?我按下面的写法,会出现后面的错误。请大家教导一下吧。
Code:
class ControlEntry(Entry) :
def __init__(self, statusAgent, master, cnf={}, **kw):
Entry.__init__(self, master, 'entry', cnf, **kw)
statusAgent.register(self)
Error Log:
File "./newpass.py", line 171, in __init__
accountEntry = ControlEntry(self.statusAgent,f1)
File "./newpass.py", line 57, in __init__
Entry.__init__(self, master, 'entry', cnf, **kw)
TypeError: __init__() takes at most 3 arguments (4 given) |
|