Greetings.
I'm trying to learn wxPython and having a bit of trouble with a focus issue.
I have a class that is a subclass of wxFrame. I'm using XRCed to develop my
GUI. I would like to be able to run a particular member every time the frame
receives focus (e.g., when the user alt-tabs to another screen and then
comes back).
Within my __init__ I have:
self.Frame = self.XRCResource.LoadFrame(None, 'frameID')
lower down I have tried:
EVT_SET_FOCUS(self, self.OnGetFocus)
self.Bind(EVT_SET_FOCUS, self.OnGetFocus)
self.Frame.Bind(EVT_SET_FOCUS, self.OnGetFocus)
For what it's worth, my OnGetFocus looks like this:
def OnGetFocus(self, Event):
self.DoGetFocusThings()
Event.Skip()
The first two event bindings I tried keep the frame from showing and return
a TypeError: Expected a pointer
The third generates no error, but doesn't ever run the DoGetFocusThings()
member.
I've Googled without finding anything that makes sense to me, and I've
searched the wxPython wiki with no luck. What should I be doing differently?
Thanks for your assistance!
-- Barry Tice