Re: Some questions about g_object_new, gtk_type_window and so on



Hi,

Each type has an associated GType value which can be retrieved using the
appropriate *_get_type() function. For a GtkButton, the function is:
GType gtk_button_get_type(void);

and GTK_TYPE_BUTTON is an equivalent macro:
#define GTK_TYPE_BUTTON gtk_button_get_type()

These are not described in the documentation since they all strictly
follow the same conventions.

Hope this helps,
Jean

Le lundi 25 juillet 2011 à 12:12 +0800, 丁少衡 a écrit :
> Hello, all.
> I wish I choose the right list to post my question and this would not
> bothering you.
> 
> I am learning gtk+ programming these days, on a debian squeeze
> platform. Almost all the document I have found teaches me that I
> should create a widget with gtk_<wiget name>_new(). However, any
> properties of a widget can be set by g_object_set(). So, I suppose
> that any widgets can be created by g_object_new(), since gtk+ is an OO
> development tool kit.
> 
> Finally, I find that a window can be created with
> g_object_new(GTK_TYPE_WINDOW, NULL), a button can be created with
> g_object_new(GTK_TYPE_BUTTON, NULL). But I cannot find out what the
> GTK_TYPE_* mean. I have searched the API documentation, but cannot
> find GTK_TYPE_WINDOW or GTK_TYPE_BUTTON etc.
> 
> Is that right using g_object_new(GTK_TYPE_WINDOW, NULL) to create a
> window? Is that an old way to create window and should not be used in
> newly written code?
> 
> If I can use that method to create widgets, where can I find documents
> about all the GTK_TYPE_*?
> 
> Thanks.
> 
> dingshaoheng
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list




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