[wxPython-users] Event when application loses focus

Rickey, Kyle W Kyle.Rickey at bakerhughes.com
Thu Nov 1 14:44:38 PDT 2007


Thanks a lot Codey, it worked perfectly.

 

 

-Kyle Rickey

-----Original Message-----
From: Cody Precord [mailto:codyprecord at gmail.com] 
Sent: Thursday, November 01, 2007 4:42 PM
To: wxPython-users at lists.wxwidgets.org
Subject: Re: [wxPython-users] Event when application loses focus

 

Hello,

 

You can bind your app to wx.EVT_ACTIVATE_APP which will fire when your
app get/looses focus, or you can wx.EVT_ACTIVATE with any of your
toplevel windows and call evt.GetActive() in the handler to see whether
it is gaining or loosing focus.

 

Cody

 

On Nov 1, 2007, at 2:34 PM, Rickey, Kyle W wrote:





Is there an event to bind to for when my application loses focus? I want
to check when a user clicks on another window such as firefox, etc. I
tried

 

self.Bind(wx.EVT_KILL_FOCUS, self.OnFocusLost)  and
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnFocusLost) but nothing happens. Is
there such an event for MSW?

 

 

-Kyle Rickey





 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20071101/1a04f93f/attachment.htm


More information about the wxpython-users mailing list