With wxPython, how does one trigger an event whenever the whole window goes into/out of focus?  
To elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the foreground.  My application is just a single window derived from wx.Frame.
In addition to what these fellows are saying, you might also want to try EVT_ENTER_WINDOW and EVT_LEAVE_WINDOW. I think these are fired when you move the mouse into and out of the frame widget, although I don't think the frame has to be in focus for those events to fire.
@ Hugh - thanks for the readership!
wxPython Whole Window Focus Event