GObject.SignalGroup¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/co |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when |
|
This signal is emitted when the target instance of self is set to a new |
Fields¶
- Inherited:
Class Details¶
- class GObject.SignalGroup(**kwargs)¶
- Bases:
- Abstract:
No
GSignalGroup
manages a collection of signals on aGObject
.GSignalGroup
simplifies the process of connecting many signals to aGObject
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
GtkTextView
andGtkTextBuffer
. Often times, you’ll need to connect to many signals onGtkTextBuffer
from aGtkTextView
subclass. This allows you to create a signal group during instance construction, simply bind theGtkTextView:buffer
property toGSignalGroup:target
and connect all the signals you need. When theGtkTextView:buffer
property changes all of the signals will be transitioned correctly.New in version 2.72.
- classmethod new(target_type)[source]¶
- Parameters:
target_type (
GObject.GType
) – theGObject.GType
of the target instance.- Returns:
a new
GObject.SignalGroup
- Return type:
Creates a new
GObject.SignalGroup
for target instances of target_type.New in version 2.72.
- block()[source]¶
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.
New in version 2.72.
- connect_closure(detailed_signal, closure, after)[source]¶
- Parameters:
detailed_signal (
str
) – a string of the formsignal-name
with optional::signal-detail
closure (
GObject.Closure
) – the closure to connect.after (
bool
) – whether the handler should be called before or after the default handler of the signal.
Connects closure to the signal detailed_signal on
GObject.SignalGroup
:target
.You cannot connect a signal handler after
GObject.SignalGroup
:target
has been set.New in version 2.74.
- connect_data(detailed_signal, c_handler, data, flags)[source]¶
- 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 c_handler to the signal detailed_signal on the target instance of self.
You cannot connect a signal handler after
GObject.SignalGroup
:target
has been set.New in version 2.72.
- connect_swapped(detailed_signal, c_handler, *data)[source]¶
- Parameters:
detailed_signal (
str
) – a string of the form “signal-name::detail”c_handler (
GObject.Callback
) – theGObject.Callback
to connect
Connects c_handler 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 c_handler.
You cannot connect a signal handler after
GObject.SignalGroup
:target
has been set.New in version 2.72.
- dup_target()[source]¶
- Returns:
The target instance
- Return type:
Gets the target instance used when connecting signals.
New in version 2.72.
- set_target(target)[source]¶
- 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 g_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.
New in version 2.72.
Signal Details¶
- GObject.SignalGroup.signals.bind(signal_group, instance)¶
- Signal Name:
bind
- Flags:
- Parameters:
signal_group (
GObject.SignalGroup
) – The object which received the signalinstance (
GObject.Object
) – aGObject.Object
containing the new value forGObject.SignalGroup
:target
This signal is emitted when
GObject.SignalGroup
:target
is set to a new value other thanNone
. It is similar toGObject.Object
::notify
ontarget
except it will not emit whenGObject.SignalGroup
:target
isNone
and also allows for receiving theGObject.Object
without a data-race.New in version 2.72.
- GObject.SignalGroup.signals.unbind(signal_group)¶
- Signal Name:
unbind
- Flags:
- Parameters:
signal_group (
GObject.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
.New in version 2.72.
Property Details¶
- GObject.SignalGroup.props.target¶
- Name:
target
- Type:
- Default Value:
- Flags:
The target instance used when connecting signals.
New in version 2.72.
- GObject.SignalGroup.props.target_type¶
- Name:
target-type
- Type:
- Default Value:
<GType GObject>
- Flags:
The
GObject.GType
of the target property.New in version 2.72.