[gtk+/refactor: 6/10] gtktogglebutton: Add _gtk_toggle_button_set_active private accessor
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/refactor: 6/10] gtktogglebutton: Add _gtk_toggle_button_set_active private accessor
- Date: Tue, 19 Oct 2010 17:20:14 +0000 (UTC)
commit 8577434274c61bd36f2e793e8ba9cc316724a73f
Author: Javier Jardón <jjardon gnome org>
Date: Tue Oct 19 18:21:56 2010 +0200
gtktogglebutton: Add _gtk_toggle_button_set_active private accessor
It's needed by gtkradiobutton
gtk/gtkradiobutton.c | 8 +++++---
gtk/gtktogglebutton.c | 7 +++++++
gtk/gtktogglebutton.h | 3 +++
3 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c
index 6eb8f84..7a51b95 100644
--- a/gtk/gtkradiobutton.c
+++ b/gtk/gtkradiobutton.c
@@ -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)
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index e1a3c16..4e0c3d6 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -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)
diff --git a/gtk/gtktogglebutton.h b/gtk/gtktogglebutton.h
index 321b472..1acab38 100644
--- a/gtk/gtktogglebutton.h
+++ b/gtk/gtktogglebutton.h
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]