I have a panda window inside of a wxPython frame, and I’m using panda to run the wxPython main loop.
The issue I have now is that I can’t type into the text control I have in that window.
...
def __init__(self):
wx.App.__init__(self)
ShowBase.__init__(self)
self.replaceEventLoop()
...
self.wxStep()
...
def replaceEventLoop(self):
self.evtLoop = wx.EventLoop()
self.oldLoop = wx.EventLoop.GetActive()
wx.EventLoop.SetActive(self.evtLoop)
taskMgr.add(self.wxStep, "evtLoopTask")
def wxStep(self, task=None):
while self.evtLoop.Pending():
self.evtLoop.Dispatch()
self.ProcessIdle()
if task != None: return task.cont
As I understand it, Panda is running the wx loop, which is fine, but I bet that panda’s not letting wx gain keyboard control. Can I tell panda to stop grabbing keyboard inputs based on the wxWindow’s focus?
Here’s the whole code for some more context if needed: http://code.google.com/p/excavation/source/browse/src/tools/collide.py#215