Hi.
I’m not particularly new to wx python, but I’m having trouble accomplishing something I need for a game I’m writing.
As I understand it, the event loop is what “drives” the gui (reacting to events sent by the toolkit as well as user code).
The normal method of starting this is with an app instance’s MainLoop method, which is about as blocking of a blocking call as you can get.
My game uses pyglet, but I really want wx for certain UI elements, and I’d rather not put the event loop into another thread if I can help it. So I’m trying to “drive” the loop on an interval from the main thread (if evtloop.Pending(): evtloop.Dispatch(), as a simple example).
The app class I’m using is attached, but for some reason I can’t fathom, it doesn’t work. Also, when I run app.GetMainLoop(), I get none, so my code isn’t registering it’s main loop properly, I guess. When I run the Show() method of any dialog, nothing happens, so I feel like it’s this “wx doesn’t think of my loop as the app’s event loop” problem that’s the real issue here.
If anyone could help, I would appreciate it, been looking into this for a few hours and I’m coming up blank; also posted a question on stack overflow (though it doesn’t have the code I’ve attached here).
wx_overrides.py (1.49 KB)