views:

12

answers:

1

Hi Experts,

I want to retrieve the position of mouse pointer in webkit's webview widget. So I tried to connect it like this.

gtk_signal_connect (GTK_OBJECT (gtk_widget_get_toplevel(web_view)), "motion-notify-event",
                      (GtkSignalFunc) motion_notify_event, NULL);

But the callback functions gets never called when mouse moves or anytime. I test it by doing the same thing with gtkentry. It worked in that case.

Please help me.

Many Thanks -Durgesh O Mishra

A: 

I'm not sure, but you can try adding GDK_POINTER_MOTION_MASK to the webview's accepted events using gtk_widget_add_events().

PS. Don't use gtk_signal_connect; it's old and will be removed in GTK 3. You should connect your signal like this:

g_signal_connect(gtk_widget_get_toplevel(web_view), "motion-notify-event", G_CALLBACK(motion_notify_event), NULL);
ptomato