The base object type
Class GObject
GObject is the fundamental type providing the common attributes and methods for all object types in GTK+, Pango and other libraries based on GObject. The GObject class provides methods for object construction and destruction, property access methods, and signal support.
Methods | |
freeze_notify | Increases the freeze count on object. |
get_property | Gets a property of an object. |
notify | Emits a "notify" signal for the property property_name on object. |
ref | Increases the reference count of object. |
ref_sink | Increase the reference count of object, and possibly remove the floating reference, if object has a floating reference. |
set_property | Sets a property on an object. |
signal_notify | The notify signal is emitted on an object when one of its properties has been changed. |
thaw_notify | Reverts the effect of a previous call to freeze_notify(). |
unref | Decreases the reference count of object. |
Increases the freeze count on object.
GObject.freeze_notify()
If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero.
This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.
Gets a property of an object.
GObject.get_property( property_name )
property_name | (string) |
Return | the property value |
Emits a "notify" signal for the property property_name on object.
GObject.notify( property_name )
property_name | (string) |
Increases the reference count of object.
GObject.ref()
Note: Don't use this...
Increase the reference count of object, and possibly remove the floating reference, if object has a floating reference.
GObject.ref_sink()
Note: Don't use this...
In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.
Sets a property on an object.
GObject.set_property( property_name, value )
property_name | name of the property to set |
value | value for the property |
w = GtkWindow() w.set_property( "title", "Falcon" )
The notify signal is emitted on an object when one of its properties has been changed.
GObject.signal_notify()
Note that getting this signal doesn't 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.
Reverts the effect of a previous call to freeze_notify().
GObject.thaw_notify()
The freeze count is decreased on object and when it reaches zero, all queued "notify" signals are emitted.
It is an error to call this function when the freeze count is zero.
Decreases the reference count of object.
GObject.unref()
Note: Don't use this...
When its reference count drops to 0, the object is finalized (i.e. its memory is freed).