I haven’t tried it on windows yet, so it may work there.
Maybe I’m approaching my problem wrong. I have a panda window embedded in a wx frame (thanks to several great examples from the forums), and I’m having trouble managing the focus between the wx frame and the panda window. If the user alt-tabs, or opens up a dialog all of the keyboard events stop working until I set the the panda window to the foreground again.
My solution (and there may be other better solutions) is to track where the cursor is and set the panda window to the foreground if the cursor is within the bounds of the panda window.
So I plan on using the origin and the window size to figure that out.
Yeah, never mind that’s a pretty stupid way to handle focus.
It’s much cleaner and simpler to just reset to foreground on mouse1 click, and it looks like panda isn’t capturing the mouse1 click when it’s in the wx controls, so it works out perfect.
self.accept('mouse1', self.click)
def click(self):
'''mouse 1 click'''
wp = WindowProperties(base.win.getProperties())
if not wp.getForeground():
wp.setForeground(True)
base.win.requestProperties(wp)
I’m still not able to grab the origin of the window though, but it’s no longer my biggest concern.