[wxpython-users] Catching user leaving the window

Werner F. Bruhin werner.bruhin at free.fr
Mon Sep 8 07:53:17 PDT 2008


Werner F. Bruhin wrote:
> ...
>>
>> Did you try EVT_LEAVE_WINDOW ? I would think that would work no 
>> matter which widget you're using, unless the OS doesn't support it.
> I tried this but no luck (Windows, Python 2.5.2, wxPython 2.8.8.1 
> Unicode)
>
> Will have to do a small sample app to make sure that it is not 
> something I do in my app.
Seems like FlatNotebook doesn't do any mouse events.

Tried:
        self.flatNotebook1.Bind(wx.EVT_LEAVE_WINDOW,
              self.OnFlatNotebook1LeaveWindow)
        self.flatNotebook1.Bind(wx.EVT_KILL_FOCUS,
              self.OnFlatNotebook1KillFocus)
        self.flatNotebook1.Bind(wx.EVT_ENTER_WINDOW,
              self.OnFlatNotebook1EnterWindow)
        self.flatNotebook1.Bind(wx.EVT_MOUSE_EVENTS,
              self.OnFlatNotebook1MouseEvents)
        self.flatNotebook1.Bind(wx.EVT_MOTION, self.OnFlatNotebook1Motion)
        self.flatNotebook1.Bind(wx.EVT_RIGHT_DOWN,
              self.OnFlatNotebook1RightDown)

None of them fire.

Is this intended?  If not what is needed to be done to get the mouse 
events to fire for a flatnotebook?

Werner

P.S.
Just did a little test with wx.Notebook and it does at least do 
EVT_MOTION and EVT_LEAVE_WINDOW.



More information about the wxpython-users mailing list