gtktogglebutton: Add _gtk_toggle_button_set_active private accessor

It's needed by gtkradiobutton
This commit is contained in:
Javier Jardón 2010-10-19 18:21:56 +02:00
parent a93e79f8d2
commit 49446ed57c
3 changed files with 15 additions and 3 deletions

View File

@ -207,7 +207,7 @@ gtk_radio_button_init (GtkRadioButton *radio_button)
gtk_widget_set_has_window (GTK_WIDGET (radio_button), FALSE);
gtk_widget_set_receives_default (GTK_WIDGET (radio_button), FALSE);
GTK_TOGGLE_BUTTON (radio_button)->active = TRUE;
_gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_button), TRUE);
GTK_BUTTON (radio_button)->depress_on_activate = FALSE;
@ -819,14 +819,16 @@ gtk_radio_button_clicked (GtkButton *button)
else
{
toggled = TRUE;
toggle_button->active = !toggle_button->active;
_gtk_toggle_button_set_active (toggle_button,
!gtk_toggle_button_get_active (toggle_button));
new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL);
}
}
else
{
toggled = TRUE;
toggle_button->active = !toggle_button->active;
_gtk_toggle_button_set_active (toggle_button,
!gtk_toggle_button_get_active (toggle_button));
tmp_list = priv->group;
while (tmp_list)

View File

@ -347,6 +347,13 @@ gtk_toggle_button_set_active (GtkToggleButton *toggle_button,
gtk_button_clicked (GTK_BUTTON (toggle_button));
}
void
_gtk_toggle_button_set_active (GtkToggleButton *toggle_button,
gboolean is_active)
{
toggle_button->active = is_active;
}
gboolean
gtk_toggle_button_get_active (GtkToggleButton *toggle_button)

View File

@ -87,6 +87,9 @@ void gtk_toggle_button_set_inconsistent (GtkToggleButton *toggle_button,
gboolean setting);
gboolean gtk_toggle_button_get_inconsistent (GtkToggleButton *toggle_button);
void _gtk_toggle_button_set_active (GtkToggleButton *toggle_button,
gboolean is_active);
G_END_DECLS