From 9a624c83b1ae7055aeafd23607380aa332adfa4a Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Wed, 17 Dec 2003 17:44:46 +0000 Subject: use g_file_test to check if the 'pixmap' argument is a file. If so, get 2003-12-17 Rodrigo Moya * gui/tasks-component.c (add_popup_menu_item): * gui/calendar-component.c (add_popup_menu_item): use g_file_test to check if the 'pixmap' argument is a file. If so, get the pixmap from it, or gtk_image_new_from_stock will return an empty pixmap. svn path=/trunk/; revision=23969 --- calendar/gui/tasks-component.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'calendar/gui/tasks-component.c') diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index 575b8ca4eb..f12e1a6078 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -288,9 +288,10 @@ add_popup_menu_item (GtkMenu *menu, const char *label, const char *pixmap, item = gtk_image_menu_item_new_with_label (label); /* load the image */ - image = gtk_image_new_from_stock (pixmap, GTK_ICON_SIZE_MENU); - if (!image) + if (g_file_test (pixmap, G_FILE_TEST_EXISTS)) image = gtk_image_new_from_file (pixmap); + else + image = gtk_image_new_from_stock (pixmap, GTK_ICON_SIZE_MENU); if (image) { gtk_widget_show (image); -- cgit v1.2.3