How it works...
We first tried to run the entire wxPython GUI application in a thread, but this did not work because the wxPython main event loop expects to be the main thread of the application.
We found a workaround for this by only running the wxPython app.MainLoop in a thread that tricks it into believing it is the main thread.
One side-effect of this approach is that we can no longer individually close all of the wxPython GUI instances. At least one of them only closes when we close the wxPython GUI that created the threads as daemons. You can test this out by clicking the Call wxPython GUI button once or several times and then try to close all the created wxPython window forms. We cannot close the last one until we close the calling ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access