[Gambas-user] Mouse.Inside() bug with collapsed Expander?

Benoît Minisini gambas at ...1...
Sat Jul 20 02:58:49 CEST 2013


Le 17/07/2013 14:22, Tobias Boege a écrit :
> On Tue, 16 Jul 2013, Fabien Bodard wrote:
>> I think Mouse.inside use the screen coords so even if the expended is
>> collapsed, the dw2 don't move in reallity. So the only thing is that
>> mouse.inside must test the visibility.
>>
>
> I don't think so :-) If it used screen coordinates, Mouse.Inside() should
> _not_ find that the mouse is inside of dwg2 when it is actually inside dwg1.
>
>> Then on other hand ... Why this user not use _enter and _leave events to
>> get the current mouse zone ?.
>
> I don't know. IIRC, he is trying to detect when the mouse is hovering part
> of a painting in the DrawingArea. Enter and Leave won't be any good then.
>
> Regards,
> Tobi
>

Mouse.Inside() returns FALSE if the control is explicitely hidden. But 
it does not take into account its actual visibility, i.e. the clipping 
of its parent containers.

To do as you expect, you must test Mouse.Inside() on the parent 
container, the grand-parent, and so on up to the top-level window.

Regards,

-- 
Benoît Minisini




More information about the User mailing list