Package: gobject

Class g-object

Superclasses

common-lisp:standard-object, common-lisp:t

Documented Subclasses

gdk-pixbuf, gdk-pixbuf-animation, gdk-pixbuf-loader, gdk-cursor, gdk-device, gdk-device-manager, gdk-device-pad, gdk-device-tool, gdk-display, gdk-display-manager, gdk-drag-context, gdk-drawing-context, gdk-frame-clock, gdk-gl-context, gdk-keymap, gdk-monitor, gdk-screen, gdk-seat, gdk-visual, gdk-window, g-action, g-action-group, g-action-map, g-app-info, g-app-launch-context, g-application-command-line, g-file, g-icon, g-list-model, g-loadable-icon, g-menu-item, g-menu-model, g-notification, g-permission, g-binding, gtk-accel-group, gtk-accel-map, gtk-actionable, gtk-activatable, gtk-app-chooser, gtk-buildable, gtk-builder, gtk-cell-area-context, gtk-cell-editable, gtk-cell-layout, gtk-clipboard, gtk-color-chooser, gtk-editable, gtk-entry-buffer, gtk-event-controller, gtk-file-chooser, gtk-font-chooser, gtk-icon-theme, gtk-im-context, gtk-orientable, gtk-page-setup, gtk-print-backend, gtk-print-context, gtk-print-job, gtk-print-operation-preview, gtk-print-settings, gtk-printer, gtk-recent-chooser, gtk-recent-manager, gtk-scrollable, gtk-settings, gtk-status-icon, gtk-style-context, gtk-style-provider, gtk-text-buffer, gtk-text-child-anchor, gtk-text-mark, gtk-text-tag, gtk-text-tag-table, gtk-tool-shell, gtk-tooltip, gtk-tree-drag-dest, gtk-tree-drag-source, gtk-tree-model, gtk-tree-selection, gtk-tree-sortable, gtk-window-group, pango-cairo-font, pango-cairo-font-map, pango-context, pango-coverage, pango-font, pango-font-face, pango-font-family, pango-font-map, pango-fontset, pango-layout, pango-renderer

Direct Slots

has-reference
Holds the value true when the instance is successfully registered.
pointer
Holds a foreign pointer to the C instance of a GObject.
signal-handlers
An array of Lisp signals handlers which are connected to the instance.

Details

The g-object class is the fundamental type providing the common attributes and methods for all object types in GTK, Pango and other libraries. The g-object class provides methods for object construction and destruction, property access methods, and signal support. Signals are described in detail in the GObject documentation.

Lisp Implementation

In the Lisp implementation three slots are added. The pointer slot holds the foreign pointer to the C instance of the object. The signal-handlers slot stores the Lisp signals which are connected to an instance with the g-signal-connect function. The has-reference slot is initialized to the value true during creation of an object. See the slot access functions for examples.

Signal Details

The "notify" signal
 lambda (object pspec)    :no-hooks    
The signal is emitted on an object when one of its properties has been changed. Note that getting this signal does not guarantee that the value of the property has actually changed, it may also be emitted when the setter for the property is called to reinstate the previous value. This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g-signal-connect function call, like this:
(g-signal-connect switch "notify::active"
   (lambda (widget pspec)
     (declare (ignore pspec))
     (if (gtk-switch-active widget)
         (setf (gtk-label-label label) "The Switch is ON")
         (setf (gtk-label-label label) "The Switch is OFF"))))    
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
object
The g-object instance which received the signal.
pspec
The g-param-spec instance of the property which changed.
 

Slot Access Functions

See also

2021-9-11