Re: gtk_adjustment_new: GtkAdjustment* vs GtkObject*?




"K. Richard Pixley" <rich@kyoto.noir.com> writes:

> I'm confused.  Why does gtk_adjustment_new return GtkObject* rather
> than GtkAdjustment*?

Probably in analogy to gtk_label_new() returning a GtkWidget * -
the idea being to return the base class instead of the derived 
class.

I personally think that was a mistake, and tend to write:

 GtkAdjustment *adj = GTK_ADJUSTMENT (gtk_adjustment_new (...));

Because you want to use an adjustment as an adjustment far
more than as a GtkObject. 

I'm not sure thought that the (minorly incompatible) change is worth
making at this point, however.

Regards,
                                        Owen



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