Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > GUI woes

Reply
Thread Tools

GUI woes

 
 
jeff elkins
Guest
Posts: n/a
 
      04-23-2005
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'
 
Reply With Quote
 
 
 
 
Kartic
Guest
Posts: n/a
 
      04-24-2005
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
 
Reply With Quote
 
 
 
 
Roger Binns
Guest
Posts: n/a
 
      04-24-2005
"jeff elkins" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
jeff elkins
Guest
Posts: n/a
 
      04-24-2005
On Sunday 24 April 2005 03:11 am, Roger Binns wrote:
> "jeff elkins" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> > 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.


 
Reply With Quote
 
jeff elkins
Guest
Posts: n/a
 
      04-24-2005
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.
 
Reply With Quote
 
jeff elkins
Guest
Posts: n/a
 
      04-24-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Baseline GUI Architecture (was: Baseline GUI Prototype?) Stefan Ram Java 3 11-20-2011 02:18 AM
PyGTK GUI update without signals from GUI Andrew Lapidas Python 0 04-12-2008 11:07 PM
GUI - GUI value passing paul.foreman Java 5 10-25-2004 08:06 AM
GUI and non-GUI data Hal Fulton Ruby 1 08-05-2004 08:42 PM
[PY GUI] interest function in python GUI(wxpython,pyqt) program.wxpython,pyqt ulysses Python 4 10-22-2003 03:28 PM



Advertisments