After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 523043 - Initialization of Glib::ObjectBase for derived types should be mentioned
Initialization of Glib::ObjectBase for derived types should be mentioned
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: documentation
2.16.x
Other All
: Normal enhancement
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2008-03-17 20:36 UTC by Moritz Ulrich
Modified: 2014-10-01 09:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Moritz Ulrich 2008-03-17 20:36:24 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.
Comment 1 Murray Cumming 2008-08-04 11:16:09 UTC
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
Comment 2 Kjell Ahlstedt 2014-06-23 08:34:07 UTC
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.
Comment 3 Kjell Ahlstedt 2014-10-01 09:02:15 UTC
I have moved the text from the documentation of PropertyProxy to the
documentation of Property.
https://git.gnome.org/browse/glibmm/commit/?id=8cd77c559fba8a894392db612280af35639e9457