GUI woes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jeff elkins

    #1

    GUI woes

    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.O nInit)
    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.EV T_SIZE, self.OnSize)
    AttributeError: MyFrame instance has no attribute 'Bind'
  • Kartic

    #2
    Re: GUI woes

    The Great jeff elkins uttered these words on 4/23/2005 5:45 PM:
    [color=blue]
    > 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.O nInit)
    > 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.EV T_SIZE, self.OnSize)
    > AttributeError: MyFrame instance has no attribute 'Bind'[/color]

    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.Fram e):
    def __init__(self, parent, id, title, pos, size, style):
    wx.Frame.__init __(self, parent, id, title, pos, size, style)
    self.Bind(wx.EV T_SIZE, self.OnSize)
    self.Show(True)

    Thanks,
    -Kartic

    Comment

    • Roger Binns

      #3
      Re: GUI woes

      "jeff elkins" <jeffelkins@ear thlink.net> wrote in message news:mailman.23 61.1114307134.1 799.python-list@python.org ...[color=blue]
      > 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[/color]

      You have a mixture of different versions of wxPython in there.
      [color=blue]
      > AttributeError: MyFrame instance has no attribute 'Bind'[/color]

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

      Roger


      Comment

      • jeff elkins

        #4
        Re: GUI woes

        On Sunday 24 April 2005 03:11 am, Roger Binns wrote:[color=blue]
        > "jeff elkins" <jeffelkins@ear thlink.net> wrote in message
        > news:mailman.23 61.1114307134.1 799.python-list@python.org ...
        >[color=green]
        > > 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[/color]
        >
        > You have a mixture of different versions of wxPython in there.
        >[color=green]
        > > AttributeError: MyFrame instance has no attribute 'Bind'[/color]
        >
        > Bind was introduced in wxPython 2.5. Looks like you are
        > running against thr 2.4 library.
        >
        > Roger[/color]

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


        Comment

        • jeff elkins

          #5
          Re: GUI woes

          On Sunday 24 April 2005 02:07 am, Kartic wrote:[color=blue]
          >
          > Jeff - Could you please post your code?
          >
          > From what you have posted it looks like your MyFrame class does not
          > inherit from wx.Frame.
          >[/color]

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

          Comment

          • jeff elkins

            #6
            Re: GUI woes

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

            Fixed and thanks for the clue :)

            Jeff

            Comment

            Working...