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



commit 3723a123d3dae84d1a08e448287c17468258fccd
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 81c66f6..2900881 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -207,13 +207,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);
+      gtk_widget_get_requisition (widget, &requisition);
       g_signal_emit_by_name (widget,
                              "size-request",
-                             &widget->requisition);
+                             &requisition);
     }
 }
 
@@ -262,15 +265,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);
@@ -280,7 +285,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]