Web lists-archives.com

Re: Changing cursor in GtkTextView





Hi Michael,

The "realize" callback looks to be a good place to set the "help" cursor. The problem is that gtktextview.c sets the "text" cursor in realize(), gtk_text_view_state_flags_changed() and gtk_text_view_unobscure_mouse_cursor(). So I think that setting the cursor in a "motion-notify-event" callback for the textview is the place for it.

Eric

...
g_signal_connect(textview1, "motion-notify-event", G_CALLBACK(textview_motion), NULL);
...
static gboolean textview_motion(GtkWidget *widget, GdkEvent *event, gpointer user_data)
  {
    GdkWindow *window=gtk_text_view_get_window(GTK_TEXT_VIEW(widget), GTK_TEXT_WINDOW_TEXT);
    GdkDisplay *display=gdk_window_get_display(window);
    GdkCursor *cursor=gdk_cursor_new_from_name(display, "help");
    gdk_window_set_cursor(window, cursor);
    g_object_unref(cursor);
    return FALSE;
  }


_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list