GdkWindow::set_cursor

void set_cursor(GdkCursor cursor);

Sets the cursor for this GdkWindow. This method is useful i.e. if you want to show that this widget executes a long-running operation and does not react.

You could set the cursor to Gdk::WATCH before running the operation, and set it back to normal afterwards.

Example 12.

//something before

$widget->window->set_cursor(new GdkCursor(Gdk::WATCH));
while (Gtk::events_pending()) {
    Gtk::main_iteration();
}

//do some operation

$widget->window->set_cursor(new GdkCursor(Gdk::LEFT_PTR));