aboutsummaryrefslogtreecommitdiff
path: root/src/gtkutils.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-23 18:01:05 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-23 18:01:05 +0000
commit90999c9a9932fe8d8f1bed21d7799db84f310076 (patch)
tree79e48eeacd4427fe31f4226e7584f9ed16fb292a /src/gtkutils.c
parent68457eb396400cc621286817298e3912e08361b1 (diff)
use GTK stock button for dialog button set.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@30 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/gtkutils.c')
-rw-r--r--src/gtkutils.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/gtkutils.c b/src/gtkutils.c
index f19f5cdf..5c5fab44 100644
--- a/src/gtkutils.c
+++ b/src/gtkutils.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -106,6 +106,38 @@ void gtkut_button_set_create(GtkWidget **bbox,
}
}
+void gtkut_stock_button_set_create(GtkWidget **bbox,
+ GtkWidget **button1, const gchar *label1,
+ GtkWidget **button2, const gchar *label2,
+ GtkWidget **button3, const gchar *label3)
+{
+ g_return_if_fail(bbox != NULL);
+ g_return_if_fail(button1 != NULL);
+
+ *bbox = gtk_hbutton_box_new();
+ gtk_button_box_set_layout(GTK_BUTTON_BOX(*bbox), GTK_BUTTONBOX_END);
+ gtk_box_set_spacing(GTK_BOX(*bbox), 5);
+
+ *button1 = gtk_button_new_from_stock(label1);
+ GTK_WIDGET_SET_FLAGS(*button1, GTK_CAN_DEFAULT);
+ gtk_box_pack_start(GTK_BOX(*bbox), *button1, TRUE, TRUE, 0);
+ gtk_widget_show(*button1);
+
+ if (button2) {
+ *button2 = gtk_button_new_from_stock(label2);
+ GTK_WIDGET_SET_FLAGS(*button2, GTK_CAN_DEFAULT);
+ gtk_box_pack_start(GTK_BOX(*bbox), *button2, TRUE, TRUE, 0);
+ gtk_widget_show(*button2);
+ }
+
+ if (button3) {
+ *button3 = gtk_button_new_from_stock(label3);
+ GTK_WIDGET_SET_FLAGS(*button3, GTK_CAN_DEFAULT);
+ gtk_box_pack_start(GTK_BOX(*bbox), *button3, TRUE, TRUE, 0);
+ gtk_widget_show(*button3);
+ }
+}
+
static void combo_button_size_request(GtkWidget *widget,
GtkRequisition *requisition,
gpointer data)