[gtk+/refactor: 17/18] gtk/gtksizerequest.c: use accessor functions to access GtkWidget



commit 3c281ddcac8cccb7d204307817719229ff54317d
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Aug 11 23:00:46 2010 +0200

    gtk/gtksizerequest.c: use accessor functions to access GtkWidget

 gtk/gtksizerequest.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 02d2e79..be77092 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -200,13 +200,16 @@ get_cache (GtkSizeRequest *widget,
 static void
 do_size_request (GtkWidget *widget)
 {
+  GtkRequisition requisition;
+
   if (GTK_WIDGET_REQUEST_NEEDED (widget))
     {
       gtk_widget_ensure_style (widget);
       GTK_PRIVATE_UNSET_FLAG (widget, GTK_REQUEST_NEEDED);
       g_signal_emit_by_name (widget,
                              "size-request",
-                             &widget->requisition);
+                             &requisition);
+      _gtk_widget_set_requisition (widget, &requisition);
     }
 }
 
@@ -255,15 +258,17 @@ compute_size_for_orientation (GtkSizeRequest    *request,
 
   if (!found_in_cache)
     {
+      GtkRequisition requisition;
       gint min_size = 0, nat_size = 0;
       gint group_size, requisition_size;
 
       /* Unconditional size request runs but is often unhandled. */
       do_size_request (widget);
 
+      gtk_widget_get_requisition (widget, &requisition);
       if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
         {
-          requisition_size = widget->requisition.width;
+          requisition_size = requisition.width;
 
           if (for_size < 0)
             GTK_SIZE_REQUEST_GET_IFACE (request)->get_width (request, &min_size, &nat_size);
@@ -273,7 +278,7 @@ compute_size_for_orientation (GtkSizeRequest    *request,
         }
       else
         {
-          requisition_size = widget->requisition.height;
+          requisition_size = requisition.height;
 
           if (for_size < 0)
             GTK_SIZE_REQUEST_GET_IFACE (request)->get_height (request, &min_size, &nat_size);



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