SignalGroup
Object Hierarchy:
Description:
[
CCode ( type_id =
"G_TYPE_SIGNAL_GROUP" ) ]
[
Version ( since =
"2.72" ) ]
public class SignalGroup :
Object
SignalGroup manages to simplify the process of connecting many signals to a
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 GtkTextView
and GtkTextBuffer
. Often times, you'll need to
connect to many signals on GtkTextBuffer
from a GtkTextView
subclass. This allows you to create a signal group during
instance construction, simply bind the GtkTextView:buffer
property to
target and connect all the signals you need. When the
GtkTextView:buffer
property changes all of the signals will be transitioned correctly.
Content:
Properties:
Creation methods:
Methods:
- public void block ()
Blocks all signal handlers managed by this
so they will not be called during any signal emissions.
- public void connect (string detailed_signal, Callback c_handler, void* data)
Connects c_handler
to the signal detailed_signal
on the target instance of this.
- public void connect_after (string detailed_signal, Callback c_handler, void* data)
Connects c_handler
to the signal detailed_signal
on the target instance of this.
- public void connect_data (string detailed_signal, Callback c_handler, void* data, ClosureNotify notify, ConnectFlags flags)
Connects c_handler
to the signal detailed_signal
on the target instance of this.
- public void connect_object (string detailed_signal, Callback c_handler, void* object, ConnectFlags flags)
Connects c_handler
to the signal detailed_signal
on target.
- public void connect_swapped (string detailed_signal, Callback c_handler, void* data)
Connects c_handler
to the signal detailed_signal
on the target instance of this.
- public Object? dup_target ()
Gets the target instance used when connecting signals.
- public void set_target (Object? target)
Sets the target instance used when connecting signals.
- public void unblock ()
Unblocks all signal handlers managed by this
so they will be called again during any signal emissions unless it is blocked again.
Signals:
- public signal void bind (Object instance)
This signal is emitted when
target is set to a new value other than
null.
- public signal void unbind ()
This signal is emitted when the target instance of self
is set
to a new Object.
Inherited Members:
All known members inherited from class GLib.Object