Re: question about instancing variables

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

 



On Wed, Jan 27, 2010 at 01:18:22PM -0200, Teste123 Teste123 wrote:
> All GTK+ codes that I see all variables are GtkWidget and after transformed
> for the widget. Example:
> 
> GtkWidget *button;
> 
> button = gtk_ button_new();
> 
> Why not directly:
> 
> GtkButton *button;

The constructors return GtkWidget*.

It can be discussed endlessly whether they should return GtkWidget* or
the specific type, anyway, you would have to do lots of typecasting in
both cases and this is simply the way it is.

Yeti

_______________________________________________
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