By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,587 Members | 1,734 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,587 IT Pros & Developers. It's quick & easy.

GUI woes

P: n/a
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'
Jul 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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
Jul 19 '05 #2

P: n/a
"jeff elkins" <je********@earthlink.net> wrote in message news:ma**************************************@pyth on.org...
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
Jul 19 '05 #3

P: n/a
On Sunday 24 April 2005 03:11 am, Roger Binns wrote:
"jeff elkins" <je********@earthlink.net> wrote in message
news:ma**************************************@pyth on.org...
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


Thanks. I'll see if I can delete/reinstall and fix things.
Jul 19 '05 #4

P: n/a
On Sunday 24 April 2005 02:07 am, Kartic wrote:

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.
Jul 19 '05 #5

P: n/a
On Sunday 24 April 2005 10:41 am, jeff elkins wrote:
On Sunday 24 April 2005 03:11 am, Roger Binns wrote:
You have a mixture of different versions of wxPython in there.
Thanks. I'll see if I can delete/reinstall and fix things.


Fixed and thanks for the clue :)

Jeff

Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.