Re: mouse enter/leave notifications for insenstive widgets



Thanks for your reply. But that might go wrong if mouse enter signal is
generated for widget-1 itself. (Suppose, some part of the widget-1 is
exposed, then that logic might not be useful).
I want to know whether mouse enter signal generated for widget-1 is due to
the mouse entering into insenstive widget-3. I tried using
gdk_window_at_pointer() to get the widget-3 when the mouse is entered on it.
However, even that API is returning me the widget-1 itself (as it is the
parent though widget-3 is actually drawn on top of widget-2) as widget-3 is
insensitive :(
Or, to prevent such enter/leave signals when mouse enters or leave
insensitive widgets.

On Thu, Apr 9, 2009 at 4:49 PM, Mike Massonnet <mmassonnet gmail com> wrote:

Le Thu, 9 Apr 2009 14:28:11 +0530,
Praveen Innamuri <ajay praveen2002 gmail com> a écrit :

I have a insensitive (disabled) widget (let's call it as widget-3)
and is drawn over a GtkContainer (let's call it as widget-2).  Both
widget-2 and widget-3 are children of a GtkContainer (let's call it
as widget-1). So, the layout is something like -
On top of widget-1, there is widget-2.
widget-3 is placed over widget-2. I can say infact, widget-2 is partly
covered by widget-3

all of these widgets are hooked to mouse enter/leave notifications.
When the mouse is moved over widget-3, the *expected* behavior has to
be either NO mouse enter/leave notifications should be signalled, or
mouse enter/leave notifications should be triggered for widget-2 as
it is drawn underneath of widget-3.
However, GTK currently triggers mouse enter/leave notification of
widget-1, which is parent of insensitive widget-3.
My Problem is - when I get Mouse enter/leave notification of widget-1
(due to mouse move over widget-3), is there any way to find out
whether that mouse enter signal is due to the mouse movement over the
insensitive widget-3 ? or is there any other way to prevent the mouse
enter signal (of widget-1) when the mouse is moved over the
insensitive widget-3 ?

I guess a simple
if (!GTK_WIDGET_IS_SENSITIVE (widget-3))
 return;
will do inside the callback of widget-1 for mouse enter/leave.

Mike
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]