2006-12-01 [wwp] 2.6.0cvs77
[claws.git] / src / gtk / gtkutils.c
index c72996d..85c6372 100644 (file)
@@ -167,6 +167,42 @@ void gtkut_stock_button_set_create(GtkWidget **bbox,
        }
 }
 
+void gtkut_stock_with_text_button_set_create(GtkWidget **bbox,
+                                  GtkWidget **button1, const gchar *label1, const gchar *text1,
+                                  GtkWidget **button2, const gchar *label2, const gchar *text2,
+                                  GtkWidget **button3, const gchar *label3, const gchar *text3)
+{
+       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_with_mnemonic(text1);
+       gtk_button_set_image(GTK_BUTTON(*button1),
+               gtk_image_new_from_stock(label1, GTK_ICON_SIZE_BUTTON));
+       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_with_mnemonic(text2);
+       gtk_button_set_image(GTK_BUTTON(*button2),
+               gtk_image_new_from_stock(label2, GTK_ICON_SIZE_BUTTON));
+               gtk_box_pack_start(GTK_BOX(*bbox), *button2, TRUE, TRUE, 0);
+               gtk_widget_show(*button2);
+       }
+
+       if (button3) {
+               *button3 = gtk_button_new_with_mnemonic(text3);
+       gtk_button_set_image(GTK_BUTTON(*button3),
+               gtk_image_new_from_stock(label3, GTK_ICON_SIZE_BUTTON));
+               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)