Bug 585211 - Add accessor function for GtkWidget->allocation
Add accessor function for GtkWidget->allocation
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
:
Depends on:
Blocks: 597610 585185 585210 586476 586731 586767 587418 588591
  Show dependency tree
 
Reported: 2009-06-09 03:16 UTC by Javier Jardón (IRC: jjardon)
Modified: 2009-10-18 06:58 UTC (History)
4 users (show)

See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
Proposed patch for gtk_widget_get_allocation() (621 bytes, patch)
2009-07-28 21:08 UTC, Cody Russell
committed Details | Diff | Review
Commit (1.07 KB, patch)
2009-08-13 15:00 UTC, Cody Russell
committed Details | Diff | Review

Description Javier Jardón (IRC: jjardon) 2009-06-09 03:16:13 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
Comment 1 Cody Russell 2009-07-28 21:08:40 UTC
Created attachment 139425 [details] [review]
Proposed patch for gtk_widget_get_allocation()
Comment 2 Javier Jardón (IRC: jjardon) 2009-08-06 09:21:32 UTC
I've reopen this bug because there isn't yet a accesor function to _set_ allocation
Comment 3 Cody Russell 2009-08-06 11:43:28 UTC
There is already gtk_widget_size_allocate()
Comment 4 Michael Natterer 2009-08-06 12:59:39 UTC
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.
Comment 5 Cody Russell 2009-08-13 15:00:32 UTC
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.
Comment 6 Emmanuele Bassi (:ebassi) 2009-08-13 15:29:11 UTC
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.
Comment 7 Cody Russell 2009-08-13 16:23:39 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.