All pastes #827690 Raw Edit

Untitled

public text v1 · immutable
#827690 ·published 2007-12-21 22:54 UTC
rendered paste body
#if GTK_CHECK_VERSION (2,6,0)
  gtk_window_set_default_icon_name( GSCHEM_THEME_ICON_NAME );
#else
  if (1) {
    GList *icon_list;
    int icon_sizes = {16, 32, 48};
    GdkPixbuf icon;
    GtkIconTheme icon_theme;
    int i;

    for ( i = 0; i < sizeof( icon_sizes ) / sizeof( *icon_sizes ); i++ ) {
      icon_theme = gtk_icon_theme_get_default();
      icon = gtk_icon_theme_load_icon( icon_theme,
                                       GSCHEM_THEME_ICON_NAME,
                                       icon_size[i],
                                       0 /* GtkIconLookupFlags flags*/
                                       NULL /* GError **error */);
      if (icon != NULL)
        icon_list = g_list_append( icon_list, icon );
    }

    gtk_window_set_default_icon_list( icon_list );

    /* Unref the GdkPixbufs */
    g_list_foreach( icon_list, (GFunc) g_object_unref, NULL );
    g_list_free( icon_list );
  }
#endif