Next: The GObject Introspection Repository Manager, Previous: The GLib Dynamic Type System, Up: The Concept of Operations [Contents][Index]
For GTK, the most important fundamental type is G_TYPE_OBJECT
.
GObject is the house of cards upon which GTK is built. GObject is the
base class for an object-oriented class system that provides specific
facilities for object-oriented programming in the context of GUIs.
Inheritance - GObject classes are arranged in a hierarchy. Each class has the fundamental GObject class as its base class. This hierarchy is single-inheritance: each class has zero or more subclasses and only one superclass.
Properties - Each instance of a GObject class has a set of zero or more typed parameters. Subclasses have access to the parameters of the parent, and subclasses may add additional parameters. These are like slots in GOOPS, except they are strongly typed.
Methods - Each GObject class may define a set of methods or generic functions that operate on that type. A subclass inherits all the methods of its superclass and may define additional methods.
Signals - GObject classes define a general purpose notification mechanism it calls signals which are messages an instance can transmit and receive2 For each instance, a callback function can be defined that is executed on the receipt of a given signal. Signals are also inherited: an instance of a subclass can catch all of the signals its parent class can catch, plus it can define new signals.
In our binding, we do our best to express GObject and subclasses to GObject in the context of GOOPS classes, but, there is some mismatch.