GTypeFlags enumeration question



Hi all,
I just rewrote the Tictactoe tutorial example from Owen Taylor at
http://www.gtk.org/tutorial/ to use the signaling in glib instead of the
deprecated signaling in gtk. The rewritten widget works fine.
However I am unsure on the proper usage of the GtkTypeFlags argument to
the g_type_register_static(...) function.

My first guess was to use it with G_TYPE_FLAG_INSTANTIATABLE as follows:

ttt_type = g_type_register_static((GType) gtk_vbox_get_type(),
"tictactoe", &ttt_info, G_TYPE_FLAG_INSTANTIATABLE); 		

Glib gives the following assertion failure at runtime, but everything
works fine:
(tictactoe:18389): GLib-GObject-CRITICAL **: file gtype.c: line 2561
(type_add_flags_W): assertion `(flags & ~TYPE_FLAG_MASK) == 0' failed

I also tried to use G_TYPE_FLAG_INSTANTIATABLE || G_TYPE_FLAG_CLASSED
but the assertion is still there.

The assertion failure goes away if I just use 0 as an argument:
	
ttt_type = g_type_register_static((GType) gtk_vbox_get_type(),
"tictactoe", &ttt_info, 0); 		

So finally here comes the question: what GTypeFlags flag should I be
using ( and preferably avoid the assertion failure ;) )?

Thanks for the help
Regards,

Antoine Dongois






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