GtkAllocation accessor
- From: Patrick Welche <prlw1 cam ac uk>
- To: gtk-list gnome org
- Subject: GtkAllocation accessor
- Date: Tue, 1 Jun 2010 14:37:29 +0100
Currently, gtk_widget_get_allocation is defined as:
void
gtk_widget_get_allocation (GtkWidget *widget,
GtkAllocation *allocation)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (allocation != NULL);
*allocation = widget->allocation;
}
To use it, I need to
GtkWidget *w = some_widget_new(some,properties);
GtkAlloction a;
gtk_widget_get_allocation(w, &a);
make use of a->width and friends
then free a?
Wouldn't
GtkAllocation * gtk_widget_get_allocation(GtkWidget *widget)
{
return widget->allocation;
}
be easier to use / less of a memory management headache as the
memory already is allocated and controlled by the widget?
Any thoughts on why it was done this way / thoughts on the addition of
say a gtk_widget_get_allocation_pointer()?
Cheers,
Patrick
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]