GNOME Bugzilla – Bug 585211
Add accessor function for GtkWidget->allocation
Last modified: 2009-10-18 06:58:43 UTC
There is not accessor functions for GtkWidget allocation. As pointed in bug #548052 (comment #3), gtk_widget_get_allocation function was disabled. Needs some general discussion about how our C api should evolve. Also see this thread: http://mail.gnome.org/archives/gtk-devel-list/2009-April/msg00150.html I'm filled this bug to tracking the progress
Created attachment 139425 [details] [review] Proposed patch for gtk_widget_get_allocation()
I've reopen this bug because there isn't yet a accesor function to _set_ allocation
There is already gtk_widget_size_allocate()
Reopening again because we still need a way to *set* widget->allocation in a widget's size_allocate() implementation. Chaining up is not a solution here because we might be overriding a parent's implementation which we don't want.
Created attachment 140669 [details] [review] Commit I went ahead and committed to master. If this is wrong, let me know and I can revise it.
as a side note, it would be good to constify that allocation parameter: void gtk_widget_set_allocation (GtkWidget *widget, const GtkAllocation *allocation); since the allocation passed is copied.
Thanks Emmanuele, committed! Also, I forgot to add the new function to gtkwidget.h and gtk.symbols earlier, so that's now committed as well.