diff --git a/docs/reference/gobject/tut_gobject.xml b/docs/reference/gobject/tut_gobject.xml index 7468a6cca..557615f97 100644 --- a/docs/reference/gobject/tut_gobject.xml +++ b/docs/reference/gobject/tut_gobject.xml @@ -113,9 +113,8 @@ MamanBar *bar = g_object_new (MAMAN_TYPE_BAR, NULL); Once g_object_new has obtained a reference to an initialized class structure, it invokes its constructor method to create an instance of the new - object. Since it has just been overridden by maman_bar_class_init - to maman_bar_constructor, the latter is called and, because it - was implemented correctly, it chains up to its parent's constructor. In + object, if the constructor has been overridden in maman_bar_class_init. + Overridden constructors must chain up to their parent’s constructor. In order to find the parent class and chain up to the parent class constructor, we can use the maman_bar_parent_class pointer that has been set up for us by the @@ -190,12 +189,12 @@ MamanBar *bar = g_object_new (MAMAN_TYPE_BAR, NULL); - Each call to g_object_new for target type - target type's class constructor method: GObjectClass->constructor + Each call to g_object_new for target type + target type's class constructor method: GObjectClass->constructor On object's instance - If you need to complete the object initialization after all the construction properties - are set, override the constructor method and make sure to chain up to the object's + If you need to handle construct properties in a custom way, or implement a singleton class, override the constructor + method and make sure to chain up to the object's parent class before doing your own initialization. In doubt, do not override the constructor method. @@ -212,6 +211,16 @@ MamanBar *bar = g_object_new (MAMAN_TYPE_BAR, NULL); This function is equivalent to C++ constructors. + + + target type's class constructed method: GObjectClass->constructed + On object's instance + + If you need to perform object initialization steps after all construct properties have been set. + This is the final step in the object initialization process, and is only called if the constructor + method returned a new object instance (rather than, for example, an existing singleton). + +