The actual widget is modelled after GtkObject . An object requires initialization which fills the data fields of a widget and increments the reference counter. In addition, both class and object must provide functions which give information about each type. This is necessary for the casting mechanism. Gtk has adopted Qt's concept of signals.
Every widget has a set of defined signals which it sends in response to different user actions.
X-server events are processed in the same manner. Gtk's widgets cover everything that is needed for GUI programming. The list is completed with a tree widget and a notebook with registers which can optionally appear on one of the four sides. Almost any widget can serve as a container for other widgets, which allows for the combination of buttons and graphics, for instance. Then there are composite widgets, e.g. for file and color selection.