How do I get the gdk window for a gtk window in C?

Erwin J. picture Erwin J. · Apr 22, 2012 · Viewed 10.1k times · Source

I'm trying to set the cursor to a watch. The problem is that gdk_set_cursor() requires a gdk_window. How do I get the gdk_window of a gtk_window in C? I've seen examples for gtkmm and pygtk but I can't find the corresponding C function.

Answer

ptomato picture ptomato · Apr 22, 2012
GdkWindow *gdk_window = gtk_widget_get_window(GTK_WIDGET(gtk_window));

or, pre GTK 2.14, but now disallowed:

GdkWindow *gdk_window = gtk_window->window;