:right-sidebar: True Breakpoint =================================================================== .. currentmodule:: gi.repository.Adw .. versionadded:: 1.4 .. class:: Breakpoint(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Buildable` :Constructors: :: Breakpoint(**properties) new(condition:Adw.BreakpointCondition) -> Adw.Breakpoint Constructors ------------ .. rst-class:: interim-class .. class:: Breakpoint :no-index: .. classmethod:: new(condition: ~gi.repository.Adw.BreakpointCondition) -> ~gi.repository.Adw.Breakpoint Creates a new ``AdwBreakpoint`` with ``condition``. .. versionadded:: 1.4 :param condition: the condition Methods ------- .. rst-class:: interim-class .. class:: Breakpoint :no-index: .. method:: add_setter(object: ~gi.repository.GObject.Object, property: str, value: ~typing.Any | None = None) -> None Adds a setter to ``self``. The setter will automatically set ``property`` on ``object`` to ``value`` when applying the breakpoint, and set it back to its original value upon unapplying it. ::: note Setting properties to their original values does not work for properties that have irreversible side effects. For example, changing :obj:`~gi.repository.Gtk.Button.props.label` while :obj:`~gi.repository.Gtk.Button.props.icon_name` is set will reset the icon. However, resetting the label will not set ``icon-name`` to its original value. Use the :obj:`~gi.repository.Adw.Breakpoint.signals.apply` and :obj:`~gi.repository.Adw.Breakpoint.signals.unapply` signals for those properties instead, as follows: .. code-block:: c :dedent: static void breakpoint_apply_cb (MyWidget *self) { gtk_button_set_icon_name (self->button, "go-previous-symbolic"); } static void breakpoint_apply_cb (MyWidget *self) { gtk_button_set_label (self->button, _("_Back")); } // ... g_signal_connect_swapped (breakpoint, "apply", G_CALLBACK (breakpoint_apply_cb), self); g_signal_connect_swapped (breakpoint, "unapply", G_CALLBACK (breakpoint_unapply_cb), self); .. versionadded:: 1.4 :param object: the target object :param property: the target property :param value: the value to set .. method:: add_setters(objects: ~typing.Sequence[~gi.repository.GObject.Object], names: ~typing.Sequence[str], values: ~typing.Sequence[~typing.Any]) -> None Adds multiple setters to ``self``. See :obj:`~gi.repository.Breakpoint.add_setter`. Example: .. code-block:: c :dedent: adw_breakpoint_add_setters (breakpoint, G_OBJECT (box), "orientation", GTK_ORIENTATION_VERTICAL, G_OBJECT (button), "halign", GTK_ALIGN_FILL, G_OBJECT (button), "valign", GTK_ALIGN_END, NULL); .. versionadded:: 1.4 :param objects: :param names: :param values: .. method:: get_condition() -> ~gi.repository.Adw.BreakpointCondition | None Gets the condition for ``self``. .. versionadded:: 1.4 .. method:: set_condition(condition: ~gi.repository.Adw.BreakpointCondition | None = None) -> None Sets the condition for ``self``. .. versionadded:: 1.4 :param condition: the new condition Properties ---------- .. rst-class:: interim-class .. class:: Breakpoint :no-index: .. attribute:: props.condition :type: ~gi.repository.Adw.BreakpointCondition The breakpoint's condition. .. versionadded:: 1.4 Signals ------- .. rst-class:: interim-class .. class:: Breakpoint.signals :no-index: .. method:: apply() -> None Emitted when the breakpoint is applied. This signal is emitted after the setters have been applied. .. versionadded:: 1.4 .. method:: unapply() -> None Emitted when the breakpoint is unapplied. This signal is emitted before resetting the setter values. .. versionadded:: 1.4