diff options
author | Javier Jardón <jjardon@gnome.org> | 2010-10-19 04:16:17 +0200 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2010-10-26 06:07:42 +0200 |
commit | a93e79f8d2c4ec609f88330527a53811200578da (patch) | |
tree | 93221b2a805345763cc467a5efecdb4349b3b20c | |
parent | 783d18650be9986788a6746616d82b675e10b3c2 (diff) | |
download | gtk+-a93e79f8d2c4ec609f88330527a53811200578da.tar.gz |
gtkradiobutton: Use accessor functions to access GtkToggleButton
-rw-r--r-- | gtk/gtkradiobutton.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c index d760d4f920..6eb8f845cd 100644 --- a/gtk/gtkradiobutton.c +++ b/gtk/gtkradiobutton.c @@ -652,7 +652,7 @@ gtk_radio_button_focus (GtkWidget *widget, /* Radio buttons with draw_indicator unset focus "normally", since * they look like buttons to the user. */ - if (!GTK_TOGGLE_BUTTON (widget)->draw_indicator) + if (!gtk_toggle_button_get_mode (GTK_TOGGLE_BUTTON (widget))) return GTK_WIDGET_CLASS (gtk_radio_button_parent_class)->focus (widget, direction); if (gtk_widget_is_focus (widget)) @@ -766,7 +766,7 @@ gtk_radio_button_focus (GtkWidget *widget, tmp_slist = priv->group; while (tmp_slist) { - if (GTK_TOGGLE_BUTTON (tmp_slist->data)->active) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tmp_slist->data))) selected_button = tmp_slist->data; tmp_slist = tmp_slist->next; } @@ -795,7 +795,7 @@ gtk_radio_button_clicked (GtkButton *button) g_object_ref (GTK_WIDGET (button)); - if (toggle_button->active) + if (gtk_toggle_button_get_active (toggle_button)) { tmp_button = NULL; tmp_list = priv->group; @@ -805,7 +805,8 @@ gtk_radio_button_clicked (GtkButton *button) tmp_button = tmp_list->data; tmp_list = tmp_list->next; - if (tmp_button->active && tmp_button != toggle_button) + if (tmp_button != toggle_button && + gtk_toggle_button_get_active (tmp_button)) break; tmp_button = NULL; @@ -833,7 +834,7 @@ gtk_radio_button_clicked (GtkButton *button) tmp_button = tmp_list->data; tmp_list = tmp_list->next; - if (tmp_button->active && (tmp_button != toggle_button)) + if (gtk_toggle_button_get_active (tmp_button) && (tmp_button != toggle_button)) { gtk_button_clicked (GTK_BUTTON (tmp_button)); break; @@ -843,12 +844,12 @@ gtk_radio_button_clicked (GtkButton *button) new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE); } - if (toggle_button->inconsistent) + if (gtk_toggle_button_get_inconsistent (toggle_button)) depressed = FALSE; else if (button->in_button && button->button_down) - depressed = !toggle_button->active; + depressed = !gtk_toggle_button_get_active (toggle_button); else - depressed = toggle_button->active; + depressed = gtk_toggle_button_get_active (toggle_button); if (gtk_widget_get_state (GTK_WIDGET (button)) != new_state) gtk_widget_set_state (GTK_WIDGET (button), new_state); @@ -913,9 +914,9 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button, if (!interior_focus || !(child && gtk_widget_get_visible (child))) x += focus_width + focus_pad; - if (toggle_button->inconsistent) + if (gtk_toggle_button_get_inconsistent (toggle_button)) shadow_type = GTK_SHADOW_ETCHED_IN; - else if (toggle_button->active) + else if (gtk_toggle_button_get_active (toggle_button)) shadow_type = GTK_SHADOW_IN; else shadow_type = GTK_SHADOW_OUT; |