GdkWindow::set_icon

void set_icon(GdkWindow window, GdkPixmap pixmap, GdkBitmap mask);

Sets the window icon which can be shown by the window manager in the title or the task bar.

This function does not work on Windows.
list( $pixmap, $mask) = gdk::pixmap_create_from_xpm($window->window, null, 'window.xpm');
$gdkwindow = $window->window;
$gdkwindow->set_icon( $gdkwindow, $pixmap, $mask);