2 * DO NOT EDIT THIS FILE - it is generated by Glade.
16 #include "pda_support.h"
19 lookup_widget (GtkWidget *widget,
20 const gchar *widget_name)
22 GtkWidget *parent, *found_widget;
26 if (GTK_IS_MENU (widget))
27 parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
29 parent = widget->parent;
31 parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
37 found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
40 g_warning ("Widget not found: %s", widget_name);
44 static GList *pixmaps_directories = NULL;
46 /* Use this function to set the directory containing installed pixmaps. */
48 add_pixmap_directory (const gchar *directory)
50 pixmaps_directories = g_list_prepend (pixmaps_directories,
51 g_strdup (directory));
54 /* This is an internally used function to find pixmap files. */
56 find_pixmap_file (const gchar *filename)
60 /* We step through each of the pixmaps directory to find it. */
61 elem = pixmaps_directories;
64 gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
65 G_DIR_SEPARATOR_S, filename);
66 if (g_file_test (pathname, G_FILE_TEST_EXISTS))
74 /* This is an internally used function to create pixmaps. */
76 create_pixmap (GtkWidget *widget,
77 const gchar *filename)
79 gchar *pathname = NULL;
82 if (!filename || !filename[0])
83 return gtk_image_new ();
85 pathname = find_pixmap_file (filename);
89 g_warning (_("Couldn't find pixmap file: %s"), filename);
90 return gtk_image_new ();
93 pixmap = gtk_image_new_from_file (pathname);
98 /* This is an internally used function to create pixmaps. */
100 create_pixbuf (const gchar *filename)
102 gchar *pathname = NULL;
104 GError *error = NULL;
106 if (!filename || !filename[0])
109 pathname = find_pixmap_file (filename);
113 g_warning (_("Couldn't find pixmap file: %s"), filename);
117 pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
120 fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
121 pathname, error->message);
122 g_error_free (error);
128 /* This is used to set ATK action descriptions. */
130 glade_set_atk_action_description (AtkAction *action,
131 const gchar *action_name,
132 const gchar *description)
136 n_actions = atk_action_get_n_actions (action);
137 for (i = 0; i < n_actions; i++)
139 if (!strcmp (atk_action_get_name (action, i), action_name))
140 atk_action_set_description (action, i, description);