开发者

Webkit WebView not able to connect to motion-notify-event

开发者 https://www.devze.com 2023-01-09 14:28 出处:网络
I want to retriev开发者_如何学Pythone the position of mouse pointer in webkit\'s webview widget. So I tried to connect it like this.

I want to retriev开发者_如何学Pythone 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 any other time. The same experiment works with gtkentry. Any idea on what might be going wrong?


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消