comparison src/gtkutil.c @ 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 c1d129148b98
children 1d493051aed3
comparison
equal deleted inserted replaced
79339:0c660f35bf59 79340:7c710af0ae5e
3474 dest_pixbuf = gdk_pixbuf_scale_simple (src_pixbuf, width, height, 3474 dest_pixbuf = gdk_pixbuf_scale_simple (src_pixbuf, width, height,
3475 GDK_INTERP_BILINEAR); 3475 GDK_INTERP_BILINEAR);
3476 3476
3477 wmenuimage = gtk_image_new_from_pixbuf (dest_pixbuf); 3477 wmenuimage = gtk_image_new_from_pixbuf (dest_pixbuf);
3478 } 3478 }
3479 else
3480 {
3481 fprintf (stderr, "internal error: GTK_IMAGE_PIXBUF failed\n");
3482 abort ();
3483 }
3484 }
3485 else if (store_type == GTK_IMAGE_ICON_NAME)
3486 {
3487 const gchar *icon_name;
3488 GtkIconSize icon_size;
3489
3490 gtk_image_get_icon_name (wimage, &icon_name, &icon_size);
3491 wmenuimage = gtk_image_new_from_icon_name (icon_name,
3492 GTK_ICON_SIZE_MENU);
3493 }
3494 else
3495 {
3496 fprintf (stderr, "internal error: store_type is %d\n", store_type);
3497 abort ();
3479 } 3498 }
3480 } 3499 }
3481 if (wmenuimage) 3500 if (wmenuimage)
3482 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (wmenuitem), wmenuimage); 3501 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (wmenuitem), wmenuimage);
3483 3502