Re: gtk_widget_get_allocation
- From: Havoc Pennington <havoc pennington gmail com>
- To: "Brian J. Tarricone" <bjt23 cornell edu>
- Cc: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Re: gtk_widget_get_allocation
- Date: Fri, 17 Apr 2009 21:41:33 -0400
Hi,
On Fri, Apr 17, 2009 at 9:38 PM, Brian J. Tarricone <bjt23 cornell edu> wrote:
> I assume the issue was with returning a non-primitive type by-value and not
> as a pointer.
Right. The normal way in glib/gtk would definitely be as you say.
> void
> gtk_widget_get_allocation (GtkWidget *widget,
> GtkAllocation *allocation)
> {
> g_return_if_fail (GTK_IS_WIDGET (widget) && allocation);
but this should be two separate checks
> memcpy (allocation, &widget->allocation, sizeof(*allocation));
and just:
*allocation = widget->allocation;
should be fine.
Presumably some core gtk dev was arguing for the weird way though or
someone would have just fixed it ;-)
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]