Re: GtkAllocation accessor



On Wed, Jun 02, 2010 at 01:31:30PM +0100, Emmanuele Bassi wrote:
> On Wed, 2010-06-02 at 12:17 +0100, Patrick Welche wrote:
> > OK, I shouldn't have mentioned memory. Trying again.
> > 
> > Why was
> > 
> >   void gtk_widget_get_allocation(GtkWidget *widget, GtkAllocation *allocation)
> > 
> > chosen, rather than
> > 
> >   GtkAllocation *gtk_widget_get_allocation(GtkWidget *widget)
> > 
> > ?
> 
> because you always want a copy of the allocation, to avoid third party
> code messing up with internal state of the widget.
> 
> and because it matches other accessors for structures in GLib and GTK+.

No it doesn't, which is why GtkAllocation is causing the problem with
GSEAL_ENABLE, viz:

  GdkWindow *gtk_widget_get_window(GtkWidget *widget);

not

  void gtk_widget_get_window(GtkWidget *widget, GdkWindow *window);

and not the other accessor functions.


Cheers,

Patrick


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