I'm using the C-style GTK functions in C++ and I can't figure out how to set the cursor for the main window.
Use gdk_window_set_cursor()
on a GdkCursor created by gdk_cursor_new_from_name()
.
To get the GdkWindow of a GtkWindow you can use gtk_widget_get_window()
because GtkWindow is a subclass of GtkWidget.
Note: this answer is an improvement over idefixs answer (important correction + link update + minor modification to make the answer complete + improved formatting) that was rejected as an edit.
Use gdk_set_cursor()
(https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#gdk-window-set-cursor)
on a GdkCursor created by gdk_cursor_new()
(https://developer.gnome.org/gdk3/stable/gdk3-Cursors.html)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With