Class ObjectClass

All Implemented Interfaces:
PointerInterface
Direct Known Subclasses:
ObjectClassExtended

public class ObjectClass extends Record
The class structure for the GObject type.
<!-- language="C" -->
 // Example of implementing a singleton using a constructor.
 static MySingleton *the_singleton = NULL;
 
 static GObject*
 my_singleton_constructor (GType                  type,
                           guint                  n_construct_params,
                           GObjectConstructParam *construct_params)
 {
   GObject *object;
   
   if (!the_singleton)
     {
       object = G_OBJECT_CLASS (parent_class)->constructor (type,
                                                            n_construct_params,
                                                            construct_params);
       the_singleton = MY_SINGLETON (object);
     }
   else
     object = g_object_ref (G_OBJECT (the_singleton));
 
   return object;
 }
 

https://docs.gtk.org/gobject/struct.ObjectClass.html