summaryrefslogtreecommitdiff
path: root/gtk/gtkradiobutton.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkradiobutton.c')
-rw-r--r--gtk/gtkradiobutton.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c
index b3294bf7aa..373623e155 100644
--- a/gtk/gtkradiobutton.c
+++ b/gtk/gtkradiobutton.c
@@ -229,6 +229,35 @@ gtk_radio_button_new_with_label (GSList *group,
return radio_button;
}
+
+/**
+ * gtk_radio_button_new_with_mnemonic:
+ * @group: the radio button group
+ * @label: the text of the button, with an underscore in front of the
+ * mnemonic character
+ * @returns: a new #GtkRadioButton
+ *
+ * Creates a new #GtkRadioButton containing a label. The label
+ * will be created using gtk_label_new_with_mnemonic(), so underscores
+ * in @label indicate the mnemonic for the button.
+ **/
+GtkWidget*
+gtk_radio_button_new_with_mnemonic (GSList *group,
+ const gchar *label)
+{
+ GtkWidget *radio_button;
+ GtkWidget *label_widget;
+
+ radio_button = gtk_radio_button_new (group);
+ label_widget = gtk_label_new_with_mnemonic (label);
+ gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
+
+ gtk_container_add (GTK_CONTAINER (radio_button), label_widget);
+ gtk_widget_show (label_widget);
+
+ return radio_button;
+}
+
GtkWidget*
gtk_radio_button_new_from_widget (GtkRadioButton *group)
{
@@ -249,6 +278,27 @@ gtk_radio_button_new_with_label_from_widget (GtkRadioButton *group,
return gtk_radio_button_new_with_label (l, label);
}
+/**
+ * gtk_radio_button_new_with_mnemonic_from_widget:
+ * @group: widget to get radio group from
+ * @label: the text of the button, with an underscore in front of the
+ * mnemonic character
+ * @returns: a new #GtkRadioButton
+ *
+ * Creates a new #GtkRadioButton containing a label. The label
+ * will be created using gtk_label_new_with_mnemonic(), so underscores
+ * in @label indicate the mnemonic for the button.
+ **/
+GtkWidget*
+gtk_radio_button_new_with_mnemonic_from_widget (GtkRadioButton *group,
+ const gchar *label)
+{
+ GSList *l = NULL;
+ if (group)
+ l = gtk_radio_button_group (group);
+ return gtk_radio_button_new_with_mnemonic (l, label);
+}
+
GSList*
gtk_radio_button_group (GtkRadioButton *radio_button)
{