Package: gobject

Class g-object

Superclasses

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

Documented Subclasses

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 signals handlers which are connected to the instance.

Details

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

Lisp Implementation

In the Lisp implementation three slots are added. The slot pointer holds the pointer to the C instance of the object. The slot signal-handlers stores all signals which are connected to an instance. The slot has-reference is initialized to the value t during creation of an object, but is not in use in the code. See the slot access functions for examples.

Signal Details

The "notify" signal
 lambda (gobject pspec)   : No Hooks    
The "notify" 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 call, like this:
 (g-signal-connect switch "notify::active"
    (lambda (widget param)
      (declare (ignore param))
      (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.
gobject
The g-object which received the signal.
pspec
The g-param-spec of the property which changed.
 

Slot Access Functions

See also

2013-6-5