problem calling method

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top