P
pieterprovoost
I'm trying to call a method within my wx frame, but that doesn't seem to work. What am I doing wrong?
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
self.Bind(wx.EVT_BUTTON, self.test, self.testbutton)
...
def sendmail(self):
...
def test(self, event):
self.sendmail()
event.Skip()
Clicking the test button returns:
Traceback (most recent call last):
File "D:\python\bx\bxgui.py", line 120, in test
self.sendmail()
AttributeError: 'MyFrame' object has no attribute 'sendmail'
Thanks!
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
self.Bind(wx.EVT_BUTTON, self.test, self.testbutton)
...
def sendmail(self):
...
def test(self, event):
self.sendmail()
event.Skip()
Clicking the test button returns:
Traceback (most recent call last):
File "D:\python\bx\bxgui.py", line 120, in test
self.sendmail()
AttributeError: 'MyFrame' object has no attribute 'sendmail'
Thanks!