Re: gtk_widget_get_allocation
- From: Hubert Figuiere <hfiguiere teaser fr>
- 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:31 -0400
On 04/17/2009 09:38 PM, Brian J. Tarricone wrote:
void
gtk_widget_get_allocation (GtkWidget *widget,
GtkAllocation *allocation)
{
g_return_if_fail (GTK_IS_WIDGET (widget) && allocation);
memcpy (allocation, &widget->allocation, sizeof(*allocation));
}
(Could also have it return gboolean, but I tend to think it's
unnecessary to have a success/fail return value when the only reason it
would fail is if the programmer is using the function incorrectly.)
I don't think it needs a boolean given the condition. Previously it was
being accessed by dereferencing the struct field.
So as you say the only it would fail it because it is used incorrectly.
In that case, it wouldn't crash, unlike before when accessing the struct
fields.
Hub
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]