I am trying to start a thread in my wxWizard application that will update a database and post events to update wxProgressDialog, but I keep getting the following error when I try to start the thread.
File "C:\Python22\Lib\site-packages\wxPython\cmndlgs.py", line 389, in __init
···
_
self.this = apply(cmndlgsc.new_wxProgressDialog,_args,_kwargs)
wxPyAssertionError: C++ assertion "wxThread::IsMain()" failed in e:\projects\wx
src\msw\app.cpp(870): only the main thread can process Windows messages
I have a class that extends wxApp and within OnInit, I create the wxWizard instance and then call the following method
I am trying to start a thread in my wxWizard application that will update a database and post events to update wxProgressDialog, but I keep getting the following error when I try to start the thread.
File "C:\Python22\Lib\site-packages\wxPython\cmndlgs.py", line 389, in __init
_
self.this = apply(cmndlgsc.new_wxProgressDialog,_args,_kwargs)
wxPyAssertionError: C++ assertion "wxThread::IsMain()" failed in e:\projects\wx
src\msw\app.cpp(870): only the main thread can process Windows messages
Looks like you are creating the progress dialog from the worker thread, rather than the main thread. The main thread is defined as the one that was active when the core wxPython module was first imported.
I have a class that extends wxApp and within OnInit, I create the wxWizard instance and then call the following method