diff options
author | Javier Jardón <jjardon@gnome.org> | 2010-10-19 18:46:40 +0200 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2010-10-26 05:02:19 +0200 |
commit | 49c409c498bf66e54d4475acb80cec45a596bd16 (patch) | |
tree | a72c724b9a206c3301344c6f236b121f06452e2c /tests | |
parent | 209715f0eff9b0cc3210605e95686242893d2dd4 (diff) | |
download | gtk+-49c409c498bf66e54d4475acb80cec45a596bd16.tar.gz |
tests: use accessor functions to access GtkToogleButton
Diffstat (limited to 'tests')
-rw-r--r-- | tests/prop-editor.c | 9 | ||||
-rw-r--r-- | tests/testgtk.c | 30 | ||||
-rw-r--r-- | tests/testselection.c | 2 |
3 files changed, 23 insertions, 18 deletions
diff --git a/tests/prop-editor.c b/tests/prop-editor.c index 62b9c7eeed..db28bbed08 100644 --- a/tests/prop-editor.c +++ b/tests/prop-editor.c @@ -364,11 +364,12 @@ bool_modified (GtkToggleButton *tb, gpointer data) GtkWidget *widget = GTK_WIDGET (p->obj); GtkWidget *parent = gtk_widget_get_parent (widget); - gtk_container_child_set (GTK_CONTAINER (parent), - widget, p->spec->name, (int) tb->active, NULL); + gtk_container_child_set (GTK_CONTAINER (parent), widget, + p->spec->name, (int) gtk_toggle_button_get_active (tb), + NULL); } else - g_object_set (p->obj, p->spec->name, (int) tb->active, NULL); + g_object_set (p->obj, p->spec->name, (int) gtk_toggle_button_get_active (tb), NULL); } static void @@ -381,7 +382,7 @@ bool_changed (GObject *object, GParamSpec *pspec, gpointer data) g_value_init (&val, G_TYPE_BOOLEAN); get_property_value (object, pspec, &val); - if (g_value_get_boolean (&val) != tb->active) + if (g_value_get_boolean (&val) != gtk_toggle_button_get_active (tb)) { block_controller (G_OBJECT (tb)); gtk_toggle_button_set_active (tb, g_value_get_boolean (&val)); diff --git a/tests/testgtk.c b/tests/testgtk.c index eec04db168..d748912894 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -1773,7 +1773,8 @@ static void sensitivity_toggled (GtkWidget *toggle, GtkWidget *widget) { - gtk_widget_set_sensitive (widget, GTK_TOGGLE_BUTTON (toggle)->active); + gtk_widget_set_sensitive (widget, + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); } static GtkWidget* @@ -1826,7 +1827,7 @@ selectable_toggled (GtkWidget *toggle, GtkWidget *widget) { set_selectable_recursive (widget, - GTK_TOGGLE_BUTTON (toggle)->active); + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); } static GtkWidget* @@ -2555,7 +2556,7 @@ static void uposition_stop_configure (GtkToggleButton *toggle, GObject *window) { - if (toggle->active) + if (gtk_toggle_button_get_active (toggle)) g_signal_handlers_block_by_func (window, G_CALLBACK (uposition_configure), NULL); else g_signal_handlers_unblock_by_func (window, G_CALLBACK (uposition_configure), NULL); @@ -3862,14 +3863,15 @@ entry_toggle_frame (GtkWidget *checkbutton, GtkWidget *entry) { gtk_entry_set_has_frame (GTK_ENTRY(entry), - GTK_TOGGLE_BUTTON(checkbutton)->active); + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton))); } static void entry_toggle_sensitive (GtkWidget *checkbutton, GtkWidget *entry) { - gtk_widget_set_sensitive (entry, GTK_TOGGLE_BUTTON(checkbutton)->active); + gtk_widget_set_sensitive (entry, + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(checkbutton))); } static gboolean @@ -3905,7 +3907,7 @@ static void entry_toggle_progress (GtkWidget *checkbutton, GtkWidget *entry) { - if (GTK_TOGGLE_BUTTON (checkbutton)->active) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton))) { guint timeout = gdk_threads_add_timeout (100, entry_progress_timeout, @@ -3928,7 +3930,7 @@ entry_toggle_pulse (GtkWidget *checkbutton, GtkWidget *entry) { g_object_set_data (G_OBJECT (entry), "progress-pulse", - GUINT_TO_POINTER ((guint) GTK_TOGGLE_BUTTON (checkbutton)->active)); + GUINT_TO_POINTER ((guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton)))); } static void @@ -4119,7 +4121,7 @@ event_box_toggle_visible_window (GtkWidget *checkbutton, GtkEventBox *event_box) { gtk_event_box_set_visible_window (event_box, - GTK_TOGGLE_BUTTON(checkbutton)->active); + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton))); } static void @@ -4127,7 +4129,7 @@ event_box_toggle_above_child (GtkWidget *checkbutton, GtkEventBox *event_box) { gtk_event_box_set_above_child (event_box, - GTK_TOGGLE_BUTTON(checkbutton)->active); + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton))); } static void @@ -4406,13 +4408,15 @@ static GtkWidget *spinner1; static void toggle_snap (GtkWidget *widget, GtkSpinButton *spin) { - gtk_spin_button_set_snap_to_ticks (spin, GTK_TOGGLE_BUTTON (widget)->active); + gtk_spin_button_set_snap_to_ticks (spin, + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))); } static void toggle_numeric (GtkWidget *widget, GtkSpinButton *spin) { - gtk_spin_button_set_numeric (spin, GTK_TOGGLE_BUTTON (widget)->active); + gtk_spin_button_set_numeric (spin, + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))); } static void @@ -6239,7 +6243,7 @@ static void notebook_popup (GtkToggleButton *button, GtkNotebook *notebook) { - if (button->active) + if (gtk_toggle_button_get_active (button)) gtk_notebook_popup_enable (notebook); else gtk_notebook_popup_disable (notebook); @@ -7700,7 +7704,7 @@ resizable_callback (GtkWidget *widget, gpointer data) { g_object_set (g_object_get_data (data, "target"), - "resizable", GTK_TOGGLE_BUTTON (widget)->active, + "resizable", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)), NULL); } diff --git a/tests/testselection.c b/tests/testselection.c index ff7a99caa6..088225e845 100644 --- a/tests/testselection.c +++ b/tests/testselection.c @@ -140,7 +140,7 @@ init_atoms (void) void selection_toggled (GtkWidget *widget) { - if (GTK_TOGGLE_BUTTON(widget)->active) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { have_selection = gtk_selection_owner_set (selection_widget, GDK_SELECTION_PRIMARY, |