[wingide-users] Wing IDE Pro trace back error but not on Eclipse/Pydev

Devl Infonews devl.infonews at gmail.com
Sun Jul 13 12:11:00 MDT 2008


Hi,
I am just learning Python and wxPython.  Meanwhile I am also trying out Wing
IDE Pro and Eclipse/Pydev and running through some of the example off of
Noel Rappin's book wxPython in Action.  The problem is I get the trace back
error on Wing IDE but not on the Eclipse/Pydev IDE.  Here is the code that
simply tells the apps to redirect stdout and stderr:

#!/usr/bin/env python

import wx
import sys

class Frame(wx.Frame):
    def __init__(self, parent, id, title):
        print "Frame __init__"
        wx.Frame.__init__(self, parent, id, title)
class App(wx.App):
    def __init__(self, redirect=True, filename=None):
        print "App __init__"
        wx.App.__init__(self, redirect, filename)
    def OnInit(self):
        print "OnInit"
        self.frame = Frame(parent=None, id=-1, title='Startup')
        self.frame.Show()
        self.SetTopWindow(self.frame)
        print >> sys.stderr, "A pretend error message"
        return True
    def OnExit(self):
        print "OnExit"

if __name__ == '__main__':
    app = App(redirect=True)
    print "before MainLoop"
    app.MainLoop()
    print "after MainLoop"

The error occurs when I close the last window.  Wing points me to
_windows.py on line 505.  The trace back message is:

TypeError: in method 'new_Frame', expected argument 1 of type 'wxWindow *'
File "..../
File "/Users/melton/work/Python/wxPython/Stdout-redirect.py", line 27, in
<module>
  app.MainLoop()
File
"//usr/local/lib/wxPython-ansi-2.8.8.0/lib/python2.5/site-packages/wx-2.8-mac-ansi/wx/_core.py",
line 7941, in MainLoop
  wx.PyApp.MainLoop(self)
File
"//usr/local/lib/wxPython-ansi-2.8.8.0/lib/python2.5/site-packages/wx-2.8-mac-ansi/wx/_core.py",
line 7267, in MainLoop
  return _core_.PyApp_MainLoop(*args, **kwargs)
File "/Users/melton/work/Python/wxPython/Stdout-redirect.py", line 22, in
OnExit
  print "OnExit"
File
"//usr/local/lib/wxPython-ansi-2.8.8.0/lib/python2.5/site-packages/wx-2.8-mac-ansi/wx/_core.py",
line 7774, in write
  self.CreateOutputWindow(text)
File
"//usr/local/lib/wxPython-ansi-2.8.8.0/lib/python2.5/site-packages/wx-2.8-mac-ansi/wx/_core.py",
line 7748, in CreateOutputWindow
  style=wx.DEFAULT_FRAME_STYLE)
File
"//usr/local/lib/wxPython-ansi-2.8.8.0/lib/python2.5/site-packages/wx-2.8-mac-ansi/wx/_windows.py",
line 505, in __init__
  _windows_.Frame_swiginit(self,_windows_.new_Frame(*args, **kwargs))

Why does it occur on Wing and not on Eclipse/Pydev?  I would be very happy
with Wing IDE If this is a wxPython error that it caught.

My environment:
PowerPC Mac OS X 10.4.11
Python 2.5.2 - MacPython distribution from from python.org
wxPython 2.8.8.0
Wing IDE Pro 3.1.2-1
Eclipse 3.4
Pydev 1.3.18


Mel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/wingide-users/attachments/20080713/46f93545/attachment.html


More information about the wingide-users mailing list