Re: Adding g_object_get_type?



Darin Adler wrote:

on 11/9/01 11:30 AM, Havoc Pennington at hp redhat com wrote:

The "official doctrine" is indeed that you should never put the
foo_get_type() functions in your code, always use FOO_TYPE macros
instead, because some types are fundamental/builtin and thus not
registered via function.


OK. It's too bad because then I have to pass the class name in three formats
for macros that do things related to classes. Normal:

  GtkObject

Function prefix style:

  gtk_object

And type macro:

  GTK_TYPE_OBJECT

If the get_type functions always existed, then I wouldn't need the third
format at all. But now I understand that this is not the gobject way.

Shouldn't you just be able to take the second form, convert to upper case and replace the first occurence of '_' with '_TYPE_'? That is what I do in my code generator for pygtk.

James.

--
Email: james daa com au
WWW:   http://www.daa.com.au/~james/







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