GObject.BindingGroup¶
class — extends Object
GBindingGroup can be used to bind multiple properties
from an object collectively.
Use the various methods to bind properties from a single source
object to multiple destination objects. Properties can be bound
bidirectionally and are connected when the source object is set
with BindingGroup.set_source.
Constructors¶
new¶
Creates a new BindingGroup.
Methods¶
bind¶
def bind(self, source_property: str, target: Object, target_property: str, flags: BindingFlags | int) -> None
Creates a binding between source_property on the source object
and target_property on target. Whenever the source_property
is changed the target_property is updated using the same value.
The binding flag BindingFlags.SYNC_CREATE is automatically specified.
See Object.bind_property for more information.
Parameters:
source_property— the property on the source to bindtarget— the targetObjecttarget_property— the property ontargetto bindflags— the flags used to create theBinding
bind_full¶
def bind_full(self, source_property: str, target: Object, target_property: str, flags: BindingFlags | int, transform_to: BindingTransformFunc | None = ..., transform_from: BindingTransformFunc | None = ...) -> None
Creates a binding between source_property on the source object and
target_property on target, allowing you to set the transformation
functions to be used by the binding. The binding flag
BindingFlags.SYNC_CREATE is automatically specified.
See Object.bind_property_full for more information.
Parameters:
source_property— the property on the source to bindtarget— the targetObjecttarget_property— the property ontargetto bindflags— the flags used to create theBindingtransform_to— the transformation function from the source object to thetarget, orNoneto use the defaulttransform_from— the transformation function from thetargetto the source object, orNoneto use the default
bind_with_closures¶
def bind_with_closures(self, source_property: str, target: Object, target_property: str, flags: BindingFlags | int, transform_to: Closure | None = ..., transform_from: Closure | None = ...) -> None
Creates a binding between source_property on the source object and
target_property on target, allowing you to set the transformation
functions to be used by the binding. The binding flag
BindingFlags.SYNC_CREATE is automatically specified.
This function is the language bindings friendly version of
g_binding_group_bind_property_full(), using GClosures
instead of function pointers.
See Object.bind_property_with_closures for more information.
Parameters:
source_property— the property on the source to bindtarget— the targetObjecttarget_property— the property ontargetto bindflags— the flags used to create theBindingtransform_to— aClosurewrapping the transformation function from the source object to thetarget, orNoneto use the defaulttransform_from— aClosurewrapping the transformation function from thetargetto the source object, orNoneto use the default
dup_source¶
Gets the source object used for binding properties.
set_source¶
Sets source as the source object used for creating property
bindings. If there is already a source object all bindings from it
will be removed.
Note that all properties that have been bound must exist on source.
Parameters:
source— the sourceObject, orNoneto clear it
Properties¶
source¶
The source object used for binding properties.