spamllama wrote:
I just started teaching myself wxPython two days ago, though I've been programming in python for about two years. I'm trying to write myself a template for a semi-complete app - a frame, toolbar, status bar and menu - both just to teach myself and to serve as a basis for later apps.
I've gotten hung up menu bar though. The app works as long as I leave the event line to handle the menu commented out. If I leave the event line in, python briefly flashes a window and crashes with the following error message:
C:\scripts>python menu.py
16:30:59: Debug: e:\Projects\wx2.4\src\msw\app.cpp(439): 'UnregisterClass(canvas
)' failed with error 0x00000584 (class still has open windows.).
16:30:59: Debug: e:\Projects\wx2.4\src\msw\app.cpp(446): 'UnregisterClass(no red
raw canvas)' failed with error 0x00000584 (class still has open windows.).
There is an error being printed to sys.stderr that you are not seeing because it is redirected to an output window which is getting closed immediately because of the errror. Change your app constructor call
app = App()
to this:
app = App(0)
to turn off the redirection and let you see the traceback being printed to the console window.
Hint: Where is the name EVT_MENU coming from?
ยทยทยท
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!