Re: Gobject Parent Errors



snowswept wrote:

Hi there!

...

GtkType
my_list_widget_get_type (void)
{
        static GtkType my_list_widget_type = 0;

        if (!my_list_widget_type) {
                static const GTypeInfo my_list_widget_info = {
                        sizeof (MyListWidgetClass),
                        NULL,           /* base_init */
                        NULL,           /* base_finalize */
                        (GClassInitFunc) my_list_widget_class_init,
                        NULL,           /* class_finalize */
                        NULL,           /* class_data */
                        sizeof (MyListWidget),
                        0,              /* n_preallocs */
                        (GInstanceInitFunc) my_list_widget_init
                };

                my_list_widget_type = g_type_register_static
(GTK_TYPE_SCROLLED_WINDOW, "MyListWidget",
                                                              &my_list_widget_info, 0);
        }

        return my_list_widget_type;
}

I think that in this function you want to return a GtkType;
so you'll need a static const GtkTypeInfo and register it like this:

        "gtk_type_unique(GTK_TYPE_OBJECT, &my_list_widget_info)"

I also think that only a GtkObject can inherit from a GtkRange
(I'm not sure about that one).


Good luck !

        -Tristan



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