problem calling method

pieterprovoost at gmail.com pieterprovoost at gmail.com
Wed Jan 14 02:28:53 CET 2009


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!

--
This message was sent on behalf of pieterprovoost at gmail.com at openSubscriber.com
http://www.opensubscriber.com/messages/python-list@python.org/topic.html



More information about the Python-list mailing list