aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-gui-utils.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2003-04-30 05:33:46 +0800
committerChris Toshok <toshok@src.gnome.org>2003-04-30 05:33:46 +0800
commit119759ca6d331bb8d527b0e271aac7023cc8726f (patch)
treef00df5672e5a296c5d8015e9d6749b3ee0c928eb /e-util/e-gui-utils.c
parent389f77ff440114e8c7731a2a8ac61f9998271184 (diff)
downloadgsoc2013-evolution-119759ca6d331bb8d527b0e271aac7023cc8726f.tar
gsoc2013-evolution-119759ca6d331bb8d527b0e271aac7023cc8726f.tar.gz
gsoc2013-evolution-119759ca6d331bb8d527b0e271aac7023cc8726f.tar.bz2
gsoc2013-evolution-119759ca6d331bb8d527b0e271aac7023cc8726f.tar.lz
gsoc2013-evolution-119759ca6d331bb8d527b0e271aac7023cc8726f.tar.xz
gsoc2013-evolution-119759ca6d331bb8d527b0e271aac7023cc8726f.tar.zst
gsoc2013-evolution-119759ca6d331bb8d527b0e271aac7023cc8726f.zip
[ for bug #41211 ]
2003-04-24 Chris Toshok <toshok@ximian.com> [ for bug #41211 ] * e-gui-utils.h (e_button_new_with_stock_icon): add prototype. * e-gui-utils.c (e_button_new_with_stock_icon): new function, allow us to create a custom labeled button with a stock icon. svn path=/trunk/; revision=21022
Diffstat (limited to 'e-util/e-gui-utils.c')
-rw-r--r--e-util/e-gui-utils.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/e-util/e-gui-utils.c b/e-util/e-gui-utils.c
index f7c2e2a458..03f1dfa4c2 100644
--- a/e-util/e-gui-utils.c
+++ b/e-util/e-gui-utils.c
@@ -2,11 +2,12 @@
/*
* GUI utility functions
*
- * Author:
+ * Authors:
* Miguel de Icaza (miguel@ximian.com)
+ * Chris Toshok (toshok@ximian.com)
*
- * (C) 1999 Miguel de Icaza
- * (C) 2000 Ximian, Inc.
+ * Copyright (C) 1999 Miguel de Icaza
+ * Copyright (C) 2000-2003 Ximian, Inc.
*/
#include <config.h>
@@ -15,6 +16,9 @@
#include <glib.h>
#include <gtk/gtkalignment.h>
#include <gtk/gtkimage.h>
+#include <gtk/gtkbutton.h>
+#include <gtk/gtklabel.h>
+#include <gtk/gtkhbox.h>
GtkWidget *e_create_image_widget(gchar *name,
gchar *string1, gchar *string2,
@@ -46,3 +50,30 @@ GtkWidget *e_create_image_widget(gchar *name,
return alignment;
}
+
+GtkWidget *
+e_button_new_with_stock_icon (const char *label_str, const char *stockid)
+{
+ GtkWidget *button, *hbox, *label, *align, *image;
+
+ button = gtk_button_new ();
+
+ label = gtk_label_new_with_mnemonic (label_str);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
+
+ image = gtk_image_new_from_stock (stockid, GTK_ICON_SIZE_BUTTON);
+ hbox = gtk_hbox_new (FALSE, 2);
+
+ align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+
+ gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+
+ gtk_container_add (GTK_CONTAINER (button), align);
+ gtk_container_add (GTK_CONTAINER (align), hbox);
+ gtk_widget_show_all (align);
+
+ return button;
+}
+