parameters: (self, event)
docstring: Event Handler for losing the focus of the Frame. Should close
          Autocomplete listbox, if shown.
docstring_summary: Event Handler for losing the focus of the Frame. Should close
          Autocomplete listbox, if shown.
docstring_tokens: Event Handler for losing the focus of the Frame . Should close Autocomplete listbox if shown .
function: def OnActivate(self, event):
          """
          Event Handler for losing the focus of the Frame. Should close
          Autocomplete listbox, if shown.
          """
          if not event.GetActive():
              # If autocomplete active, cancel it.  Otherwise, the
              # autocomplete list will stay visible on top of the
              # z-order after switching to another application
              win = wx.Window.FindFocus()
              if hasattr(win, 'AutoCompActive') and win.AutoCompActive():
                  win.AutoCompCancel()
          event.Skip()
function_tokens: def OnActivate ( self , event ) : if not event . GetActive ( ) : # If autocomplete active, cancel it.  Otherwise, the # autocomplete list will stay visible on top of the # z-order after switching to another application win = wx . Window . FindFocus ( ) if hasattr ( win , 'AutoCompActive' ) and win . AutoCompActive ( ) : win . AutoCompCancel ( ) event . Skip ( )