[gtk+] Add widget->allocation setter method



commit 2ba836defb0a862307e02209939dcd20970adf96
Author: Cody Russell <bratsche gnome org>
Date:   Thu Aug 13 09:57:25 2009 -0500

    Add widget->allocation setter method
    
    Add gtk_widget_set_allocation() to be used by size_allocate() methods,
    since widget->allocation is now sealed.  Bug #585211

 gtk/gtkwidget.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 267bd40..02810f0 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10769,6 +10769,26 @@ gtk_widget_get_allocation (GtkWidget     *widget,
 }
 
 /**
+ * gtk_widget_set_allocation:
+ * @widget: a #GtkWidget
+ * @allocation: a pointer to a #GtkAllocation to copy from
+ *
+ * Sets the widget's allocation.  This should not be used
+ * directly, but from within a widget's size_allocate method.
+ *
+ * Since: 2.18
+ */
+void
+gtk_widget_set_allocation (GtkWidget     *widget,
+                           GtkAllocation *allocation)
+{
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_if_fail (allocation != NULL);
+
+  widget->allocation = *allocation;
+}
+
+/**
  * gtk_widget_get_window:
  * @widget: a #GtkWidget
  *



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