Michael_Perkonigg@uniquare.com wrote:
Hello!
I am trying to figure out how to use wxPython (designed with wxGlade) but
everytime I'm doing something wrong I get this error message when running
my program:
09:53:07: Debug: c:\PROJECTS\wx\src\msw\app.cpp(439):
'UnregisterClass(canvas)'
failed with error 0x00000584 (class still has open windows.).
09:53:07: Debug: c:\PROJECTS\wx\src\msw\app.cpp(446): 'UnregisterClass(no
redraw
canvas)' failed with error 0x00000584 (class still has open windows.).
Nothing else, no python error message, nothing.
I designed the frame with wxGlade and wasn't even able to clear the
listboxes in the init method at first without getting this strange error
message.
System is Windows2000, Python 2.2.1, wxPython 2.4.1.2.
Thanks,
Mike
(See attached file: wxDbTool.py)
Are you sure the error message isn't being displayed in a pop-up window, and then disappearing because the program crashes? That's what happens when I try it (albeit Win98, wxPython 2.4.0.3). You can add
def __init__(self):
wxApp.__init__(self, 1, "dberr")
to MyApp to cause these error messages to be appended to the file dberr. When I did that I got
Traceback (most recent call last):
File "wxDbTool.py", line 167, in ?
wxDbTool = MyApp()
File "wxDbTool.py", line 156, in __init__
wxApp.__init__(self, 1, "dberr")
File "E:\PYTHON22\Lib\site-packages\wxPython\wx.py", line 1748, in __init__
_wxStart(self.OnInit)
File "wxDbTool.py", line 159, in OnInit
frame_1 = MyFrame(None, -1, "")
File "wxDbTool.py", line 125, in __init__
self.notebook_1 = MyNotebook(self, -1)
File "wxDbTool.py", line 33, in __init__
EVT_BUTTON (self.pbGetDb, self.GetDb)
TypeError: EVT_BUTTON() takes exactly 3 arguments (2 given)
because you need to insert self before the other two arguments of EVT_BUTTON.
David