[gtk+/refactor: 9/106] Use accessor functions to access GtkBox



commit 723fc67b68767466667a547fcd9827d68bf48372
Author: Javier Jardón <jjardon gnome org>
Date:   Tue May 25 01:57:10 2010 +0200

    Use accessor functions to access GtkBox

 gtk/gtkbbox.c               |   12 ++++++------
 gtk/gtkfilechooserdefault.c |    2 +-
 gtk/gtkstatusbar.c          |    6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c
index 4f68309..826e310 100644
--- a/gtk/gtkbbox.c
+++ b/gtk/gtkbbox.c
@@ -348,7 +348,7 @@ gtk_button_box_get_child_secondary (GtkButtonBox *widget,
   g_return_val_if_fail (GTK_IS_WIDGET (child), FALSE);
 
   child_info = NULL;
-  list = GTK_BOX (widget)->children;
+  list = gtk_container_get_children (GTK_CONTAINER (widget));
   while (list)
     {
       child_info = list->data;
@@ -394,7 +394,7 @@ gtk_button_box_set_child_secondary (GtkButtonBox *widget,
   g_return_if_fail (GTK_IS_WIDGET (child));
   g_return_if_fail (child->parent == GTK_WIDGET (widget));
 
-  list = GTK_BOX (widget)->children;
+  list = gtk_container_get_children (GTK_CONTAINER (widget));
   while (list)
     {
       GtkBoxChild *child_info = list->data;
@@ -468,7 +468,7 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
 
   nchildren = 0;
   nsecondaries = 0;
-  children = GTK_BOX(bbox)->children;
+  children = gtk_container_get_children (GTK_CONTAINER (bbox));
   needed_width = child_min_width;
   needed_height = child_min_height;  
   ipad_w = ipad_x * 2;
@@ -539,7 +539,7 @@ gtk_button_box_size_request (GtkWidget      *widget,
   priv = bbox->priv;
 
   orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
-  spacing = box->spacing;
+  spacing = gtk_box_get_spacing (box);
   layout = priv->layout_style != GTK_BUTTONBOX_DEFAULT_STYLE
            ? priv->layout_style : gtk_button_box_kludge_get_layout_default (GTK_BUTTON_BOX (widget));
 
@@ -625,7 +625,7 @@ gtk_button_box_size_allocate (GtkWidget     *widget,
   priv = box->priv;
 
   orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
-  spacing = base_box->spacing;
+  spacing = gtk_box_get_spacing (base_box);
   layout = priv->layout_style != GTK_BUTTONBOX_DEFAULT_STYLE
            ? priv->layout_style : gtk_button_box_kludge_get_layout_default (GTK_BUTTON_BOX (widget));
   _gtk_button_box_child_requisition (widget,
@@ -793,7 +793,7 @@ gtk_button_box_size_allocate (GtkWidget     *widget,
         childspace = child_height + childspacing;
       }
 
-  children = GTK_BOX (box)->children;
+  children = gtk_container_get_children (GTK_CONTAINER (box));
 
   while (children)
     {
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index e340d7f..b3a80cc 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -8026,7 +8026,7 @@ gtk_file_chooser_default_get_default_size (GtkFileChooserEmbed *chooser_embed,
 	  gtk_widget_get_visible (impl->extra_widget))
 	{
 	  gtk_widget_size_request (impl->extra_align, &req);
-	  *default_height += GTK_BOX (chooser_embed)->spacing + req.height;
+	  *default_height += gtk_box_get_spacing (GTK_BOX (chooser_embed)) + req.height;
 	}
     }
   else
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index 3d72d43..0ee091d 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -245,8 +245,8 @@ gtk_statusbar_init (GtkStatusbar *statusbar)
 
   gtk_widget_set_redraw_on_allocate (GTK_WIDGET (box), TRUE);
 
-  box->spacing = 2;
-  box->homogeneous = FALSE;
+  gtk_box_set_spacing (box, 2);
+  gtk_box_set_homogeneous (box, FALSE);
 
   statusbar->has_resize_grip = TRUE;
 
@@ -985,7 +985,7 @@ has_extra_children (GtkStatusbar *statusbar)
     return TRUE;
 
   frame = NULL;
-  for (l = GTK_BOX (statusbar)->children; l; l = l->next)
+  for (l = gtk_container_get_children (GTK_CONTAINER (statusbar)); l; l = l->next)
     {
       frame = l->data;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]