GUI woes

Discussion in 'Python' started by jeff elkins, Apr 23, 2005.

  1. jeff elkins

    jeff elkins Guest

    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'
     
    jeff elkins, Apr 23, 2005
    #1
    1. Advertising

  2. jeff elkins

    Kartic Guest

    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
     
    Kartic, Apr 24, 2005
    #2
    1. Advertising

  3. jeff elkins

    Roger Binns Guest

    "jeff elkins" <> wrote in message news:...
    > 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
     
    Roger Binns, Apr 24, 2005
    #3
  4. jeff elkins

    jeff elkins Guest

    On Sunday 24 April 2005 03:11 am, Roger Binns wrote:
    > "jeff elkins" <> wrote in message
    > news:...
    >
    > > 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.
     
    jeff elkins, Apr 24, 2005
    #4
  5. jeff elkins

    jeff elkins Guest

    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.
     
    jeff elkins, Apr 24, 2005
    #5
  6. jeff elkins

    jeff elkins Guest

    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
     
    jeff elkins, Apr 24, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. paul.foreman

    GUI - GUI value passing

    paul.foreman, Oct 22, 2004, in forum: Java
    Replies:
    5
    Views:
    782
    Michael Rauscher
    Oct 25, 2004
  2. ulysses
    Replies:
    4
    Views:
    802
    Werner Schiendl
    Oct 22, 2003
  3. Andrew Lapidas

    PyGTK GUI update without signals from GUI

    Andrew Lapidas, Apr 13, 2008, in forum: Python
    Replies:
    0
    Views:
    428
    Andrew Lapidas
    Apr 13, 2008
  4. Stefan Ram
    Replies:
    3
    Views:
    509
    Arne Vajhøj
    Nov 20, 2011
  5. Hal Fulton

    GUI and non-GUI data

    Hal Fulton, Aug 5, 2004, in forum: Ruby
    Replies:
    1
    Views:
    158
    Austin Ziegler
    Aug 5, 2004
Loading...

Share This Page