1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/gui/support.c Tue Dec 19 09:51:35 2006 +0000
1.5 + * DO NOT EDIT THIS FILE - it is generated by Glade.
1.8 +#ifdef HAVE_CONFIG_H
1.9 +# include <config.h>
1.12 +#include <sys/types.h>
1.13 +#include <sys/stat.h>
1.14 +#include <unistd.h>
1.15 +#include <string.h>
1.20 +#include "support.h"
1.23 +lookup_widget (GtkWidget *widget,
1.24 + const gchar *widget_name)
1.26 + GtkWidget *parent, *found_widget;
1.30 + if (GTK_IS_MENU (widget))
1.31 + parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
1.33 + parent = widget->parent;
1.35 + parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
1.36 + if (parent == NULL)
1.41 + found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
1.43 + if (!found_widget)
1.44 + g_warning ("Widget not found: %s", widget_name);
1.45 + return found_widget;
1.48 +/* This is an internally used function to create pixmaps. */
1.50 +create_pixmap (GtkWidget *widget,
1.51 + const gchar *filename)
1.53 + GtkWidget *pixmap;
1.56 + if (!filename || !filename[0])
1.57 + return gtk_image_new ();
1.59 + pathname = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP,
1.60 + filename, TRUE, NULL);
1.63 + g_warning (_("Couldn't find pixmap file: %s"), filename);
1.64 + return gtk_image_new ();
1.67 + pixmap = gtk_image_new_from_file (pathname);
1.68 + g_free (pathname);
1.72 +/* This is an internally used function to create pixmaps. */
1.74 +create_pixbuf (const gchar *filename)
1.76 + gchar *pathname = NULL;
1.77 + GdkPixbuf *pixbuf;
1.78 + GError *error = NULL;
1.80 + if (!filename || !filename[0])
1.83 + pathname = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP,
1.84 + filename, TRUE, NULL);
1.88 + g_warning (_("Couldn't find pixmap file: %s"), filename);
1.92 + pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
1.95 + fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
1.96 + pathname, error->message);
1.97 + g_error_free (error);
1.99 + g_free (pathname);
1.103 +/* This is used to set ATK action descriptions. */
1.105 +glade_set_atk_action_description (AtkAction *action,
1.106 + const gchar *action_name,
1.107 + const gchar *description)
1.109 + gint n_actions, i;
1.111 + n_actions = atk_action_get_n_actions (action);
1.112 + for (i = 0; i < n_actions; i++)
1.114 + if (!strcmp (atk_action_get_name (action, i), action_name))
1.115 + atk_action_set_description (action, i, description);