integrating a wxPython GUI into a Panda app

It appears that something has changed in recent versions of wxPython, so that:

while self.app.Pending():
         self.app.Dispatch() 

no longer functions. It is not clear from looking at their documentation whether this is an unintended bug, or whether the intended interface has changed to something different.

It’s probably worth asking over at the wxPython forums for guidance.

If you’re not able to find out how to run wxPython without having it take over the main loop, you may have to reverse it, so that wxPython is the main loop and Panda is the client. You’ll probably have to use wxPython timers to get a callback frequently enough to keep your 3-D performance up; but in my past experience, I had difficulty getting frequent callbacks out of wxPython, even with timers. Maybe it’s gotten better recently.

You might also have luck by putting the app.MainLoop() call inside a thread, but this is dangerous because (a) you will have two different threads (Panda and wxPython) sending window commands in parallel, which is a recipe for a crash on Linux, and (b) every callback from wxPython will be made in a thread, so your application will have to be carefully written to prevent data corruption.

Good luck!

David