Re: GtkAllocation accessor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

> #if GTK_CHECK_VERSION (2,18,0)
> static GtkAllocation *dasher_get_widget_allocation(GtkWidget *w)
> {
>        GtkAllocation a;
>
>        gtk_widget_get_allocation(w, &a);
>
>        return &a;
> }
> #endif

Just don't do this. Returning a pointer to a stack-allocated structure
is just screaming "SIGSEGV".

I can agree that updating applications to work with GTK+-3 will be a
major pain in the *** in some cases (yours being one example), but I
fail to see why would newly written applications need to suffer from
inconsistent API just to make old apps a bit happier (they will still
need to be updated).

Tadej

-- 
Tadej Borovšak
tadeboro.blogspot.com
tadeboro@xxxxxxxxx
tadej.borovsak@xxxxxxxxx
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list



[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux