[Glade-users] cannot register existing type



On Wed, Jan 29, 2014 at 7:34 PM, Andrea Zagli <azagli at libero.it> wrote:
i have 2 custom widgets: GtkMaskedEntry and GtkDateEntry

GtkDateEntry is a GtkBin with inside GtkMaskedEntry

i created catalogs and pixmaps to use them with glade (version 3.14.3); but
when i try to insert widget GtkDateEntry inside a container (ex. GtkBox) i
got the error

GLib-GObject-WARNING **: cannot register existing type `GtkMaskedEntry'
(glade.exe:5052): GLib-CRITICAL **: g_once_init_leave: assertion `result !=
0' failed
(glade.exe:5052): GLib-GObject-CRITICAL **: g_object_new: assertion
`G_TYPE_IS_OBJECT (object_type)' failed

and glade crash (if i insert GtkMaskedEntry it works)

in glade 3.8.x they works perfectly

what could be the problem?

Does one derive from the other ?

If it does, the parent class should be defined before the child class inside
the catalog.

How is the catalog defined ? Are you linking to the module/library containing
these widgets or are you faking the type using the "parent" xml attribute of
the <glade-widget-class> tag ?

If you can send us the catalog we could make a better guess at what's going
wrong here.

Also, a little besides the point: NEVER define custom widgets that are called
GtkAnything, 'Gtk' is reserved for the GTK+ namespace, so as soon as GTK+
decides to go ahead and declare a GtkDateEntry of its own, your code breaks.

Call it PonyDateEntry, assuming your widget library or application is
called Pony.

Cheers,
    -Tristan




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