GNOME Bugzilla – Bug 523043
Initialization of Glib::ObjectBase for derived types should be mentioned
Last modified: 2014-10-01 09:02:15 UTC
I had today a hard time to find an error with a own property of an Gtk::Cellrenderer. I got much runtime-errors. With help from murrayc I could make it work, the call to a constructor of Glib::ObjectBase was missing. I think it would help if the needed call to the constructor to set a custom type name were mentioned in the documentation or in the eBook. A good place could be the doc for Glib::PropertyProxy.
Thanks. I have added this text to the API reference for PropertyProxy: * You may register new properties for your class (actually for the underlying GType) * simply by adding a PropertyProxy instance as a class member. * However, your constructor must call the Glib::ObjectBase constructor with a new GType name, * in order to register a new GType. We should maybe add text like this to the doxygen class documentation for CellRenderer, and almost anything with overridable vfuncs. See also: http://bugzilla.gnome.org/show_bug.cgi?id=546220
Is PropertyProxy docs really the right place for the text in comment 1? PropertyProxy does not register properties. That's what Glib::Property does. See also the middle paragraph of bug 140515 comment 21.
I have moved the text from the documentation of PropertyProxy to the documentation of Property. https://git.gnome.org/browse/glibmm/commit/?id=8cd77c559fba8a894392db612280af35639e9457