problems with window_set_icon()



I'm trying to change the icon that appears in the top bar (window 
decoration) of my Gtk app on a Win98 machine.  I've tried changing both 
the default icons and the icon for the wondow, but I always get the GTK 
cube.  Here is the relevant source:


int main( int argc, char *argv[] )
{
 GtkWidget *vbox, *hbox, *sw, *treeview, *button;
 GtkTreeModel *model;
 GtkTreeIter iter;
 GError *err=NULL;
 GList *icons=NULL;
 int i;

 gtk_init (&argc, &argv);

 icons = 
  g_list_append (icons, (gpointer)gdk_pixbuf_new_from_file 
("stock_dialog_info_16.png", &err));
 icons = 
  g_list_append (icons, (gpointer)gdk_pixbuf_new_from_file 
("stock_dialog_info_32.png", &err));
 icons = 
  g_list_append (icons, (gpointer)gdk_pixbuf_new_from_file 
("stock_dialog_info_48.png", &err));

for (i=0; i<3; i++)
g_print ("icon %d is %dx%d\n", i,
gdk_pixbuf_get_width  ((GdkPixbuf *)g_list_nth_data(icons,i)),
gdk_pixbuf_get_height ((GdkPixbuf *)g_list_nth_data(icons,i)));

 gtk_window_set_default_icon_list (icons);
 main_app_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 gtk_window_set_icon_list (GTK_WINDOW (main_app_window), icons);
 gtk_window_set_title (GTK_WINDOW (main_app_window), "Mercury");
...
 gtk_widget_show_all (main_app_window);
 gtk_main ();
 return 0;
}

Here is the output of the g_print loop:

icon 0 is 16x16
icon 1 is 32x32
icon 2 is 48x48


Joe Orgren
Senior Engineer
Organizational Strategies Inc.
Supporting the Applied Technology Division/OIT
Bureau of Customs & Border Protection
United States Department of Homeland Security
202-927-3967
202-927-2002




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]