The Great jeff elkins uttered these words on 4/23/2005 5:45 PM:

test.py crashes with the error below. Any clues?

===========

Running test.py:

Traceback (most recent call last):
File "./test.py", line 87, in ?
app = MyApp(0) # Create an instance of the application class
File "/usr/lib/python2.3/site-packages/wxPython/wx.py", line 1951, in __init__
_wxStart(self.OnInit)
File "./test.py", line 76, in OnInit
frame = MyFrame(None, -1, "This is a test")
File "./test.py", line 26, in __init__
self.Bind(wx.EVT_SIZE, self.OnSize)
AttributeError: MyFrame instance has no attribute 'Bind'

Jeff - Could you please post your code?

From what you have posted it looks like your MyFrame class does not inherit from wx.Frame.

Your class should be defined like this:
class MyFrame(wx.Frame):
        def __init__(self, parent, id, title, pos, size, style):
                wx.Frame.__init__(self, parent, id, title, pos, size, style)
                self.Bind(wx.EVT_SIZE, self.OnSize)
                self.Show(True)

Thanks,
-Kartic
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to