Re: problem with stock icons



Havoc!

Thanks for your explanation, it works now.

Andre

On Sun, 21.09.2003 at 12:44 PM, Havoc Pennington wrote:
On Sun, 2003-09-21 at 06:57, Andre Lerche wrote:

button1 = gtk_button_new ();
tmp = gtk_widget_render_icon (w, GTK_STOCK_GO_UP, GTK_ICON_SIZE_MENU, NULL);
pixbuf = gdk_pixbuf_scale_simple (tmp, 10, 50, GDK_INTERP_BILINEAR);
g_object_unref (tmp);
image1 = gtk_image_new_from_pixbuf (pixbuf);

In this case your GtkImage just has pixel data, it doesn't know that it
came from a stock icon. How could it? Thus it will not update on theme
changes. You could connect to the style_set signal to detect theme
changes, and update your pixbuf manually in that case.

button2 = gtk_button_new ();
image2 = gtk_image_new_from_stock (GTK_STOCK_GO_UP,
GTK_ICON_SIZE_MENU);

In this case you've given the GtkImage enough information for it to
automatically update on theme changes. i.e. you passed in the high-level
stock icon information, instead of just pixel data.

Havoc

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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