Main Page | Data Structures | File List | Data Fields | Globals

support.h File Reference

#include <gnome.h>

Go to the source code of this file.

Functions

GtkWidget * lookup_widget (GtkWidget *widget, const gchar *widget_name)
GtkWidget * create_pixmap (GtkWidget *widget, const gchar *filename)
GdkPixbuf * create_pixbuf (const gchar *filename)
void glade_set_atk_action_description (AtkAction *action, const gchar *action_name, const gchar *description)


Function Documentation

GdkPixbuf* create_pixbuf const gchar *  filename  ) 
 

Definition at line 89 of file support.c.

Referenced by create_about(), and create_window1().

00090 {
00091   gchar *pathname = NULL;
00092   GdkPixbuf *pixbuf;
00093   GError *error = NULL;
00094 
00095   if (!filename || !filename[0])
00096       return NULL;
00097 
00098   pathname = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP,
00099                                         filename, TRUE, NULL);
00100 
00101   if (!pathname)
00102     {
00103       g_warning (_("Couldn't find pixmap file: %s"), filename);
00104       return NULL;
00105     }
00106 
00107   pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
00108   if (!pixbuf)
00109     {
00110       fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
00111                pathname, error->message);
00112       g_error_free (error);
00113     }
00114   g_free (pathname);
00115   return pixbuf;
00116 }

GtkWidget* create_pixmap GtkWidget *  widget,
const gchar *  filename
 

Definition at line 65 of file support.c.

Referenced by create_window1().

00067 {
00068   GtkWidget *pixmap;
00069   gchar *pathname;
00070 
00071   if (!filename || !filename[0])
00072       return gtk_image_new ();
00073 
00074   pathname = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP,
00075                                         filename, TRUE, NULL);
00076   if (!pathname)
00077     {
00078       g_warning (_("Couldn't find pixmap file: %s"), filename);
00079       return gtk_image_new ();
00080     }
00081 
00082   pixmap = gtk_image_new_from_file (pathname);
00083   g_free (pathname);
00084   return pixmap;
00085 }

void glade_set_atk_action_description AtkAction *  action,
const gchar *  action_name,
const gchar *  description
 

Definition at line 120 of file support.c.

00123 {
00124   gint n_actions, i;
00125 
00126   n_actions = atk_action_get_n_actions (action);
00127   for (i = 0; i < n_actions; i++)
00128     {
00129       if (!strcmp (atk_action_get_name (action, i), action_name))
00130         atk_action_set_description (action, i, description);
00131     }
00132 }

GtkWidget* lookup_widget GtkWidget *  widget,
const gchar *  widget_name
 

Definition at line 38 of file support.c.

Referenced by refresh(), update_cpu(), and update_mem().

00040 {
00041   GtkWidget *parent, *found_widget;
00042 
00043   for (;;)
00044     {
00045       if (GTK_IS_MENU (widget))
00046         parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
00047       else
00048         parent = widget->parent;
00049       if (!parent)
00050         parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
00051       if (parent == NULL)
00052         break;
00053       widget = parent;
00054     }
00055 
00056   found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
00057                                                  widget_name);
00058   if (!found_widget)
00059     g_warning ("Widget not found: %s", widget_name);
00060   return found_widget;
00061 }


Generated on Wed Feb 15 11:24:02 2006 for lkmonitor by  doxygen 1.3.9.1