GUI woes

J

jeff elkins

Howdy,

This may not belong here, if so apologies...

I'm a python newbie, but have completed a console app that I'd like to run
under X. Reading recent postings here, wxpython seemed a reasonable choice so
under debian sid, I installed (via apt-get) the various wxpython stuff
available.:

libwxgtk2.4-python
libwxgtk2.5.3-python
python-opengl
python-pythoncard
python2.1-opengl
python2.2-opengl
python2.3-opengl
python2.3-pythoncard
pythoncard
pythoncard-doc
pythoncard-tools
wx2.5-examples
wxpython2.5.3
wxwin2.4-examples

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'
 
K

Kartic

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
 
R

Roger Binns

jeff elkins said:
under debian sid, I installed (via apt-get) the various wxpython stuff
available.:

libwxgtk2.4-python
libwxgtk2.5.3-python
python-opengl
python-pythoncard
python2.1-opengl
python2.2-opengl
python2.3-opengl
python2.3-pythoncard
pythoncard
pythoncard-doc
pythoncard-tools
wx2.5-examples
wxpython2.5.3
wxwin2.4-examples

You have a mixture of different versions of wxPython in there.
AttributeError: MyFrame instance has no attribute 'Bind'

Bind was introduced in wxPython 2.5. Looks like you are
running against thr 2.4 library.

Roger
 
J

jeff elkins

You have a mixture of different versions of wxPython in there.


Bind was introduced in wxPython 2.5. Looks like you are
running against thr 2.4 library.

Roger

Thanks. I'll see if I can delete/reinstall and fix things.
 
J

jeff elkins

Jeff - Could you please post your code?

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

Thanks Kartic. That test.py was from the wxpython download site.
 

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