changeset 79340:7c710af0ae5e

(xg_tool_bar_menu_proxy): Handle GTK_IMAGE_ICON_NAME and abort with a message on unhandled store_type values.
author Jan Djärv <jan.h.d@swipnet.se>
date Tue, 06 Nov 2007 11:17:22 +0000
parents 0c660f35bf59
children 07b3310d9342
files src/gtkutil.c
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkutil.c	Mon Nov 05 06:40:26 2007 +0000
+++ b/src/gtkutil.c	Tue Nov 06 11:17:22 2007 +0000
@@ -3476,6 +3476,25 @@
 
               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)