]> Pileus Git - ~andy/gtk/commitdiff
gtkradiobutton: Use accessor functions to access GtkToggleButton
authorJavier Jardón <jjardon@gnome.org>
Tue, 19 Oct 2010 02:16:17 +0000 (04:16 +0200)
committerJavier Jardón <jjardon@gnome.org>
Tue, 26 Oct 2010 04:07:42 +0000 (06:07 +0200)
gtk/gtkradiobutton.c

index d760d4f9209edc886edf3dac005cb77e92a935d7..6eb8f845cd67e9582e3b0ffe1422a7ffe6d8e302 100644 (file)
@@ -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;