(xg_tool_bar_menu_proxy): Handle GTK_IMAGE_ICON_NAME and

abort with a message on unhandled store_type values.
This commit is contained in:
Jan Djärv 2007-11-06 09:27:17 +00:00
parent 8635fef07a
commit e624c3f96c
2 changed files with 25 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2007-11-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* gtkutil.c (xg_tool_bar_menu_proxy): Handle GTK_IMAGE_ICON_NAME and
abort with a message on unhandled store_type values.
2007-11-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* xterm.c, xfns.c, xselect.c, xterm.h, s/msdos.h, s/sco4.h, s/sco5.h:

View file

@ -3460,6 +3460,7 @@ xg_tool_bar_menu_proxy (toolitem, user_data)
GtkImage *wimage = GTK_IMAGE (gtk_bin_get_child (GTK_BIN (wbutton)));
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (wbutton));
GtkImageType store_type = gtk_image_get_storage_type (wimage);
if (store_type == GTK_IMAGE_STOCK)
{
gchar *stock_id;
@ -3489,6 +3490,25 @@ xg_tool_bar_menu_proxy (toolitem, user_data)
wmenuimage = gtk_image_new_from_pixbuf (dest_pixbuf);
}
else
{
fprintf (stderr, "internal error: GTK_IMAGE_PIXBUF failed\n");
abort ();
}
}
else if (store_type == GTK_IMAGE_ICON_NAME)
{
const gchar *icon_name;
GtkIconSize icon_size;
gtk_image_get_icon_name (wimage, &icon_name, &icon_size);
wmenuimage = gtk_image_new_from_icon_name (icon_name,
GTK_ICON_SIZE_MENU);
}
else
{
fprintf (stderr, "internal error: store_type is %d\n", store_type);
abort ();
}
}
if (wmenuimage)