Re: [gtk-list] Getting mouse motion events for child windows of widgets
- From: Martin Pool <mbp wistful humbug org au>
 
- To: gtk-list redhat com
 
- Subject: Re: [gtk-list] Getting mouse motion events for child windows of widgets
 
- Date: Mon, 10 Aug 1998 19:14:35 +1000
 
On Sun, Aug 09, 1998 at 09:19:27PM +0100, Damon Chaplin wrote:
> 
> I need to get motion_notify events for all windows/widgets so I can
> change the mouse cursor to show resizing handles.
> 
> If I simply connect to the widgets' motion_notify signals I don't
> always get the event (e.g. I don't get motion_notify events inside
> the text window of an entry or spinbutton).
> 
> I've tried using gdk_window_set_events() on all of the windows but
> that doesn't work. I've even tried gdk_window_add_filter() to see all
> events for all windows, but I never see any motion_notify events for
> these windows (I see them for everything else).
My understanding is: the motion_notify event means "there are motion
events for you to look at."  You then need to retrieve the events
using gdk_input_window_get_pointer, or gdk_input_motion_events.
vis:
gint
model_darea_motion_event (GtkWidget *widget,
			  GdkEventMotion *event)
{
  gdouble		x, y;
  GdkModifierType	mask;
  gint			row, col, hit;
  gchar			pos_str[100];
  /* TODO: display extra information about the element under the
   * pointer. */
  gdk_input_window_get_pointer (event->window, event->deviceid,
				&x, &y, NULL, NULL, NULL,
				&mask);
  hit = screen_to_element (x, y, &row, &col);
  ...
}
-- 
Martin Pool
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]