Class

GObjectSignalGroup

Description

final class GObject.SignalGroup : GObject.Object {
  /* No available fields */
}

GSignalGroup manages to simplify the process of connecting many signals to a GObject 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 GSignalGroup:target and connect all the signals you need. When the GtkTextView:buffer property changes all of the signals will be transitioned correctly.

Available since:2.72

Hierarchy

hierarchy this GSignalGroup ancestor_0 GObject ancestor_0--this

Ancestors

Constructors

g_signal_group_new

Creates a new GSignalGroup for target instances of target_type.

Available since: 2.72

Instance methods

g_signal_group_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.

Available since: 2.72

g_signal_group_connect

Connects c_handler to the signal detailed_signal on the target instance of self.

Available since: 2.72

g_signal_group_connect_after

Connects c_handler to the signal detailed_signal on the target instance of self.

Available since: 2.72

g_signal_group_connect_closure

Connects closure to the signal detailed_signal on GSignalGroup:target.

Available since: 2.74

g_signal_group_connect_data

Connects c_handler to the signal detailed_signal on the target instance of self.

Available since: 2.72

g_signal_group_connect_object

Connects c_handler to the signal detailed_signal on GSignalGroup:target.

Available since: 2.72

g_signal_group_connect_swapped

Connects c_handler to the signal detailed_signal on the target instance of self.

Available since: 2.72

g_signal_group_dup_target

Gets the target instance used when connecting signals.

Available since: 2.72

g_signal_group_set_target

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.

Available since: 2.72

g_signal_group_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.

Available since: 2.72

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

GObject.SignalGroup:target

The target instance used when connecting signals.

Available since: 2.72

GObject.SignalGroup:target-type

The GType of the target property.

Available since: 2.72

Signals

GObject.SignalGroup::bind

This signal is emitted when GSignalGroup:target is set to a new value other than NULL. It is similar to GObject::notify on target except it will not emit when GSignalGroup:target is NULL and also allows for receiving the GObject without a data-race.

Available since: 2.72

GObject.SignalGroup::unbind

This signal is emitted when the target instance of self is set to a new GObject.

Available since: 2.72

Signals inherited from GObject (1)
GObject.Object::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.