:right-sidebar: True SignalGroup =================================================================== .. currentmodule:: gi.repository.GObject .. versionadded:: 2.72 .. class:: SignalGroup(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` :Constructors: :: SignalGroup(**properties) new(target_type:GType) -> GObject.SignalGroup Constructors ------------ .. rst-class:: interim-class .. class:: SignalGroup :no-index: .. classmethod:: new(target_type: type) -> ~gi.repository.GObject.SignalGroup Creates a new :obj:`~gi.repository.GObject.SignalGroup` for target instances of ``target_type``. .. versionadded:: 2.72 :param target_type: the :obj:`~gi.repository.GObject.Type` of the target instance. Methods ------- .. rst-class:: interim-class .. class:: SignalGroup :no-index: .. method:: block() -> None 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. .. versionadded:: 2.72 .. method:: connect_closure(detailed_signal: str, closure: ~typing.Callable[[...], ~typing.Any], after: bool) -> None Connects ``closure`` to the signal ``detailed_signal`` on :obj:`~gi.repository.GObject.SignalGroup`:target. You cannot connect a signal handler after :obj:`~gi.repository.GObject.SignalGroup`:target has been set. .. versionadded:: 2.74 :param detailed_signal: a string of the form ``signal-name`` with optional ``::signal-detail`` :param closure: the closure to connect. :param after: whether the handler should be called before or after the default handler of the signal. .. method:: connect_data(detailed_signal: str, c_handler: ~typing.Callable[[...], None], flags: ~gi.repository.GObject.ConnectFlags, *data: ~typing.Any) -> None Connects ``c_handler`` to the signal ``detailed_signal`` on the target instance of ``self``. You cannot connect a signal handler after :obj:`~gi.repository.GObject.SignalGroup`:target has been set. .. versionadded:: 2.72 :param detailed_signal: a string of the form "signal-name::detail" :param c_handler: the :obj:`~gi.repository.GObject.Callback` to connect :param flags: the flags used to create the signal connection :param data: the data to pass to ``c_handler`` calls .. method:: connect_swapped(detailed_signal: str, c_handler: ~typing.Callable[[...], None], *data: ~typing.Any) -> None 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 :obj:`~gi.repository.GObject.SignalGroup`:target has been set. .. versionadded:: 2.72 :param detailed_signal: a string of the form "signal-name::detail" :param c_handler: the :obj:`~gi.repository.GObject.Callback` to connect :param data: the data to pass to ``c_handler`` calls .. method:: dup_target() -> ~gi.repository.GObject.Object | None Gets the target instance used when connecting signals. .. versionadded:: 2.72 .. method:: set_target(target: ~gi.repository.GObject.Object | None = None) -> None Sets the target instance used when connecting signals. Any signal that has been registered with :func:`~gi.repository.GObject.SignalGroup.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``. .. versionadded:: 2.72 :param target: The target instance used when connecting signals. .. method:: unblock() -> None 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. .. versionadded:: 2.72 Properties ---------- .. rst-class:: interim-class .. class:: SignalGroup :no-index: .. attribute:: props.target :type: ~gi.repository.GObject.Object The target instance used when connecting signals. .. versionadded:: 2.72 .. attribute:: props.target_type :type: type The :obj:`~gi.repository.GObject.Type` of the target property. .. versionadded:: 2.72 Signals ------- .. rst-class:: interim-class .. class:: SignalGroup.signals :no-index: .. method:: bind(instance: ~gi.repository.GObject.Object) -> None This signal is emitted when :obj:`~gi.repository.GObject.SignalGroup`:target is set to a new value other than :const:`None`. It is similar to :obj:`~gi.repository.GObject.Object`::notify on ``target`` except it will not emit when :obj:`~gi.repository.GObject.SignalGroup`:target is :const:`None` and also allows for receiving the :obj:`~gi.repository.GObject.Object` without a data-race. .. versionadded:: 2.72 :param instance: a :obj:`~gi.repository.GObject.Object` containing the new value for :obj:`~gi.repository.GObject.SignalGroup`:target .. method:: unbind() -> None This signal is emitted when the target instance of ``self`` is set to a new :obj:`~gi.repository.GObject.Object`. This signal will only be emitted if the previous target of ``self`` is non-:const:`None`. .. versionadded:: 2.72