gtk_radio_button_set_group (GtkRadioButton *radio_button,
GSList *group)
{
- g_return_if_fail (radio_button != NULL);
g_return_if_fail (GTK_IS_RADIO_BUTTON (radio_button));
g_return_if_fail (!g_slist_find (group, radio_button));
const gchar *label)
{
GtkWidget *radio_button;
- GtkWidget *label_widget;
- radio_button = gtk_radio_button_new (group);
- label_widget = gtk_label_new (label);
- gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
+ radio_button = g_object_new (GTK_TYPE_RADIO_BUTTON, "label", label, NULL) ;
- gtk_container_add (GTK_CONTAINER (radio_button), label_widget);
- gtk_widget_show (label_widget);
+ if (group)
+ gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_button), group);
return radio_button;
}
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);
+ radio_button = g_object_new (GTK_TYPE_RADIO_BUTTON, "label", label, "use_underline", TRUE, NULL);
- gtk_container_add (GTK_CONTAINER (radio_button), label_widget);
- gtk_widget_show (label_widget);
+ if (group)
+ gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_button), group);
return radio_button;
}
GSList*
gtk_radio_button_get_group (GtkRadioButton *radio_button)
{
- g_return_val_if_fail (radio_button != NULL, NULL);
g_return_val_if_fail (GTK_IS_RADIO_BUTTON (radio_button), NULL);
return radio_button->group;
GtkRadioButton *tmp_button;
GSList *tmp_list;
- g_return_if_fail (object != NULL);
g_return_if_fail (GTK_IS_RADIO_BUTTON (object));
radio_button = GTK_RADIO_BUTTON (object);
tmp_button->group = radio_button->group;
}
+ /* this button is no longer in the group */
+ radio_button->group = NULL;
+
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
GSList *tmp_list;
gint toggled;
- g_return_if_fail (button != NULL);
g_return_if_fail (GTK_IS_RADIO_BUTTON (button));
radio_button = GTK_RADIO_BUTTON (button);
gint x, y;
gint indicator_size, indicator_spacing;
- g_return_if_fail (check_button != NULL);
g_return_if_fail (GTK_IS_RADIO_BUTTON (check_button));
if (GTK_WIDGET_VISIBLE (check_button) && GTK_WIDGET_MAPPED (check_button))
x = widget->allocation.x + widget->allocation.width - (indicator_size + x - widget->allocation.x);
gtk_paint_option (widget->style, widget->window,
- GTK_WIDGET_STATE (widget), shadow_type,
+ state_type, shadow_type,
area, widget, "radiobutton",
x, y, indicator_size, indicator_size);
}