GtkWindow::set_icon

void set_icon( GdkPixbuf icon ]);

Sets icon as the icon for the window. The icon will be used when the window is minimized and may also be used in the task manager or window frame.

The image should be set in its original size. Scaling will be done automatically before the icon is shown.

If the image for the icon exists in multiple sizes, use set_icon_list() . The most appropriate size image from the list will be used in each instance where the icon is shown.

Example 160. Using a stock icon as window icon

$wnd = new GtkWindow();
$pixbuf = $wnd->render_icon(
    Gtk::STOCK_FIND,
    Gtk::ICON_SIZE_DIALOG
);
$wnd->set_icon($pixbuf);

This example uses render_icon() to create a GdkPixbuf from a GtkStockItems enum, together with a GtkIconSize size definition.

See also: get_icon() , set_icon_list()