Mouse enter/leave events of a frame

Thanks Federico.

That means you customized every windows in your frame? I wonder if you
can just have a customized frame and be free to add any kind of widgets
you want. If that is impossible, I guess I'll have to customized
everything in the frame.

···

-----Original Message-----
From: Federico Ceccatto [mailto:z.darkmere@gmail.com]
Sent: 09 August 2006 12:09
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Mouse enter/leave events of a frame

I know this is a very rudimentary solution, and I'm sure someone will
chip in with a solid solution involving the event handler.

I had a similar problem a while ago, and since it was for a minor set
of controls with the identical number and type of childrens (just 3
staticbitmaps and a statictext), what I did was to have all 4 four
windows (panel and childrens) to set/unset each one a particular bit
in a bitmask whenever there was an Enter_Window or Leave_Window event.
If the bitmask dropped to zero, then I knew they were not involved
with the position of the mouse.

-F

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Please notify the sender by e-mail or telephone.
We utilise an anti-virus system and therefore any files sent via e-mail will have been checked for known viruses. You are however advised to run your own virus check before opening any attachments received as we will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received. Any views expressed by an individual within this e-mail do not necessarily reflect the views of Systems Union Group plc or any of its subsidiary companies.

Unfortunately, yes, I had to to subclass everything. Mind you, they
all were to begin with, as I was drawing a fancy tab with alpha
blending.

It's not a very good solution for larger problems, tough, some ideas:

Does it have to exit the frame inmediatly upon leaving the app's area?
Otherwise you can rig a Timer to periodically call the static method
wx.GetMousePosition() and compare the results against the area covered
by your frame. Get a rect of the frame with GetClientRect(), offset it
by an (x,y) tuple as provided by [frame].ClientToScreen((0,0)), and
then check if the mouse position is inside the rect, (Offset and
Inside in wx.Rect will be very useful).