Re: problem with stock icons
- From: Havoc Pennington <hp redhat com>
- To: Andre Lerche <a lerche gmx net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: problem with stock icons
- Date: 21 Sep 2003 12:44:09 -0400
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]