Re: Puzzled by gtk_grab_add() behaviour, can anyone help?




john@giorgio.hart.bbk.ac.uk writes:

> Hi all, I'm trying to use gtk_grab_add(), and I think I'm doing something
> wrong. 
> 
> As expected, after I grab I get motion events wherever I move the mouse
> (outside the window, into other event boxes, into buttons etc), and these
> other widgets don't get events.
> 
> However, if (during the grab) I mouse over a GtkEntry or over the central
> raised part of a scollbar, my motion events stop. Why is this? Is there
> anything I can do to stop this happening? All advice warmly welcomed.

gtk_grab_add() only redirects existing events, it doesn't
change the current event masks of widgets - so if they aren't
asking for motion events, then you won't get them

If you want to actually get all events, then you want use
gdk_pointer_grab() - something like:


 gdk_pointer_grab (eventbox->window, FALSE, GDK_MOTION | GDK_BUTTON_RELEASE,
                   NULL, NULL, time);

Regards,
                                        Owen



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