Dazzle.SignalGroup¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
The target instance used when connecting signals. |
||
r/w/co |
The |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when the target instance of self is set to a new |
|
This signal is emitted when the target instance of self is set to a new |
Fields¶
- Inherited:
Class Details¶
- class Dazzle.SignalGroup(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Dazzle.SignalGroup
manages to simplify the process of connecting many signals to aGObject.Object
as a group. As such there is no API to disconnect a signal from the group.In particular, this allows you to:
Change the target instance, which automatically causes disconnection of the signals from the old instance and connecting to the new instance.
Block and unblock signals as a group
Ensuring that blocked state transfers across target instances.
One place you might want to use such a structure is with
Gtk.TextView
andGtk.TextBuffer
. Often times, you’ll need to connect to many signals onGtk.TextBuffer
from aGtk.TextView
subclass. This allows you to create a signal group during instance construction, simply bind theGtk.TextView
:buffer
property toDazzle.SignalGroup
:target
and connect all the signals you need. When theGtk.TextView
:buffer
property changes all of the signals will be transitioned correctly.- classmethod new(target_type)¶
- Parameters:
target_type (
GObject.GType
) – theGObject.GType
of the target instance.- Returns:
a new
Dazzle.SignalGroup
- Return type:
Creates a new
Dazzle.SignalGroup
for target instances of target_type.
- block()¶
Blocks all signal handlers managed by self so they will not be called during any signal emissions. Must be unblocked exactly the same number of times it has been blocked to become active again.
This blocked state will be kept across changes of the target instance.
See:
GObject.signal_handler_block
().
- connect_data(detailed_signal, c_handler, data, flags)¶
- Parameters:
detailed_signal (
str
) – a string of the form “signal-name::detail”c_handler (
GObject.Callback
) – theGObject.Callback
to connectflags (
GObject.ConnectFlags
) – the flags used to create the signal connection
Connects callback to the signal detailed_signal on the target instance of self.
See: g_signal_connect_data().
- connect_swapped(detailed_signal, c_handler, *data)¶
- Parameters:
detailed_signal (
str
) – a string of the form “signal-name::detail”c_handler (
GObject.Callback
) – theGObject.Callback
to connect
Connects callback to the signal detailed_signal on the target instance of self.
The instance on which the signal is emitted and data will be swapped when calling callback.
See: g_signal_connect_swapped().
- get_target()¶
- Returns:
The target instance.
- Return type:
Gets the target instance used when connecting signals.
- set_target(target)¶
- Parameters:
target (
GObject.Object
orNone
) – The target instance used when connecting signals.
Sets the target instance used when connecting signals. Any signal that has been registered with dzl_signal_group_connect_object() or similar functions will be connected to this object.
If the target instance was previously set, signals will be disconnected from that object prior to connecting to target.
- unblock()¶
Unblocks all signal handlers managed by self so they will be called again during any signal emissions unless it is blocked again. Must be unblocked exactly the same number of times it has been blocked to become active again.
See:
GObject.signal_handler_unblock
().
Signal Details¶
- Dazzle.SignalGroup.signals.bind(signal_group, instance)¶
- Signal Name:
bind
- Flags:
- Parameters:
signal_group (
Dazzle.SignalGroup
) – The object which received the signalinstance (
GObject.Object
) – aGObject.Object
This signal is emitted when the target instance of self is set to a new
GObject.Object
.This signal will only be emitted if the target of self is non-
None
.
- Dazzle.SignalGroup.signals.unbind(signal_group)¶
- Signal Name:
unbind
- Flags:
- Parameters:
signal_group (
Dazzle.SignalGroup
) – The object which received the signal
This signal is emitted when the target instance of self is set to a new
GObject.Object
.This signal will only be emitted if the previous target of self is non-
None
.
Property Details¶
- Dazzle.SignalGroup.props.target¶
- Name:
target
- Type:
- Default Value:
- Flags:
The target instance used when connecting signals.
- Dazzle.SignalGroup.props.target_type¶
- Name:
target-type
- Type:
- Default Value:
<GType GObject>
- Flags:
The
GObject.GType
of the target property.