Re: the GInstanceInitFunc of my GtkWidget subclass is never called



Will Webekind wrote:

I'm writing a widget that is similar to GtkDrawingArea.  I started with
the code from gtkdrawingarea.{c|h} in gtk+-2.2.2.  My problem is that the
widget instance initiation function gtk_ogla_init is not called when I
create a new instance.  I'm probably just missing some mundane detail, but
I'd appreciate it if anyone could put me on the right path.  The
condensed version of my code is listed below.  Thanks for the help.

-Will

It might make sence to add the last argument to g_type_register_static()

type =  g_type_register_static (GTK_TYPE_WIDGET, "MyType",   &type_info,
                                               (G_TYPE_FLAG_CLASSED |
G_TYPE_FLAG_INSTANTIATABLE |
                                                G_TYPE_FLAG_DERIVABLE));

(this is my guess; why call a instance_init function on a non-instantiatable class ?)

Cheers,
                   -Tristan






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