gtk+ r20622 - trunk/gtk



Author: timj
Date: Fri Jun 20 11:09:56 2008
New Revision: 20622
URL: http://svn.gnome.org/viewvc/gtk+?rev=20622&view=rev

Log:
Fix gtk_widget_get_allocation


Modified:
   trunk/gtk/gtkwidget.c
   trunk/gtk/gtkwidget.h

Modified: trunk/gtk/gtkwidget.c
==============================================================================
--- trunk/gtk/gtkwidget.c	(original)
+++ trunk/gtk/gtkwidget.c	Fri Jun 20 11:09:56 2008
@@ -9890,19 +9890,23 @@
 /**
  * gtk_widget_get_allocation:
  * @widget: a #GtkWidget
+ * @allocation: a #GtkAllocation
  *
- * Returns the widget's allocation as provided by its parent.
- *
- * Return value: current allocation of @widget.
+ * Fills @allocation with the widget's allocation as provided by its parent.
  *
  * Since: GSEAL-branch
  */
-GtkAllocation
-gtk_widget_get_allocation (GtkWidget *widget)
+void
+gtk_widget_get_allocation (GtkWidget     *widget,
+                           GtkAllocation *allocation)
 {
-  g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_if_fail (allocation != NULL);
 
-  return widget->allocation;
+  allocation->x = widget->allocation.x;
+  allocation->y = widget->allocation.y;
+  allocation->width = widget->allocation.width;
+  allocation->height = widget->allocation.height;
 }
 
 /**

Modified: trunk/gtk/gtkwidget.h
==============================================================================
--- trunk/gtk/gtkwidget.h	(original)
+++ trunk/gtk/gtkwidget.h	Fri Jun 20 11:09:56 2008
@@ -572,7 +572,8 @@
 void                  gtk_widget_set_child_visible      (GtkWidget    *widget,
 							 gboolean      is_visible);
 gboolean              gtk_widget_get_child_visible      (GtkWidget    *widget);
-GtkAllocation         gtk_widget_get_allocation         (GtkWidget    *widget);
+void		      gtk_widget_get_allocation         (GtkWidget    *widget,
+							 GtkAllocation*allocation);
 GdkWindow*            gtk_widget_get_window             (GtkWidget    *widget);
 
 GtkWidget *gtk_widget_get_parent          (GtkWidget           *widget);



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