[wxPython] How to debug?

I have a problem, and I'll bet it stems from me not
using wxWindows properly, though I don't know how to
get any info that would tell me what exactly the
problem is.

Im using wxPython, I have created the usual wxApp ->
wxFrame to begin with, and I have also created a
wxSplitterWindow with the frame as parent. On the left
pane I have a wxWindow and wxStaticText inside it, and
the same on the right side, it works fine and
displays, and I can move the sash around no problem.
However, when I make the left pane a wxListCtrl, it
blow up.

The real problem is that I don't get any output as to
what the problem is.

when I run my script from a command shell, I get a
little window, what looks like a textctrl, pop up and
then it dissapears half-second later. weird. and I get
this as output in the command shell:

7:03:19 AM: Debug:
c:\Projects\wx\src\msw\app.cpp(535):
'UnregisterClass(canvas)
' failed with error 0x00000584 (class still has open
windows.).
7:03:19 AM: Debug:
c:\Projects\wx\src\msw\app.cpp(542):
'UnregisterClass(no redr
aw canvas)' failed with error 0x00000584 (class still
has open windows.).
7:03:19 AM: There were memory leaks.
7:03:19 AM: ----- Memory dump -----
7:03:19 AM: wxFrame at $878C18, size 332
... etc. etc. etc. and many more objects and a bunch
of other useless crap...

As you can see, this doesn't tell me anything about
why what I'm trying to do isn't working.

So the big question is:
How do you all debug you'r wxPython applications?

Im running the debug build of the wxWindows library,
how do I get it to give me usefull error info?

···

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

I use Wing IDE. www.wingide.com.

Jeff Sasmor
jeff@sasmor.com
www.netkook.com is an "open Zope CMF site"

···

----- Original Message -----
From: "Eric Mangold" <ericmangold@yahoo.com>
To: <wxpython-users@lists.wxwindows.org>
Sent: Tuesday, February 19, 2002 8:12 AM
Subject: [wxPython] How to debug?

I have a problem, and I'll bet it stems from me not
using wxWindows properly, though I don't know how to
get any info that would tell me what exactly the
problem is.

Im using wxPython, I have created the usual wxApp ->
wxFrame to begin with, and I have also created a
wxSplitterWindow with the frame as parent. On the left
pane I have a wxWindow and wxStaticText inside it, and
the same on the right side, it works fine and
displays, and I can move the sash around no problem.
However, when I make the left pane a wxListCtrl, it
blow up.

The real problem is that I don't get any output as to
what the problem is.

when I run my script from a command shell, I get a
little window, what looks like a textctrl, pop up and
then it dissapears half-second later. weird. and I get
this as output in the command shell:

7:03:19 AM: Debug:
c:\Projects\wx\src\msw\app.cpp(535):
'UnregisterClass(canvas)
' failed with error 0x00000584 (class still has open
windows.).
7:03:19 AM: Debug:
c:\Projects\wx\src\msw\app.cpp(542):
'UnregisterClass(no redr
aw canvas)' failed with error 0x00000584 (class still
has open windows.).
7:03:19 AM: There were memory leaks.
7:03:19 AM: ----- Memory dump -----
7:03:19 AM: wxFrame at $878C18, size 332
... etc. etc. etc. and many more objects and a bunch
of other useless crap...

As you can see, this doesn't tell me anything about
why what I'm trying to do isn't working.

So the big question is:
How do you all debug you'r wxPython applications?

Im running the debug build of the wxWindows library,
how do I get it to give me usefull error info?

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

Eric Mangold wrote:

The real problem is that I don't get any output as to
what the problem is.

when I run my script from a command shell, I get a
little window, what looks like a textctrl, pop up and
then it dissapears half-second later. weird.

Do you start your app with something like:

    application = MainApp(0)
    application.MainLoop()

The important bit is the MainApp(0) (a class derived from wxApp), more
specifically the 0. If you have anything else there, i.e. nothing, or
some other number, try putting a 0 there. That should prevent any error
messages from being redirected.

Also, it's probably best to run your app from an editor which captures
the outpu, so you can scroll back to any errors. Personally, I prefer
to use SciTE for Python stuff.

Robert Amesz