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
GSignalGroupmanages a collection of signals on aGObject.GSignalGroupsimplifies the process of connecting many signals to aGObjectas 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
GtkTextViewandGtkTextBuffer. Often times, you’ll need to connect to many signals onGtkTextBufferfrom aGtkTextViewsubclass. This allows you to create a signal group during instance construction, simply bind theGtkTextView:bufferproperty toGSignalGroup:targetand connect all the signals you need. When theGtkTextView:bufferproperty 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.GTypeof the target instance.- Returns:
a new
GObject.SignalGroup- Return type:
Creates a new
GObject.SignalGroupfor 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-namewith optional::signal-detailclosure (
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:targethas 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.Callbackto 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:targethas 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.Callbackto 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:targethas 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.ObjectorNone) – 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.Objectcontaining the new value forGObject.SignalGroup:target
This signal is emitted when
GObject.SignalGroup:targetis set to a new value other thanNone. It is similar toGObject.Object::notifyontargetexcept it will not emit whenGObject.SignalGroup:targetisNoneand also allows for receiving theGObject.Objectwithout 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.GTypeof the target property.New in version 2.72.