Breakpoint

Added in version 1.4.

class Breakpoint(**properties: Any)

Superclasses: Object

Implemented Interfaces: Buildable

Constructors:

Breakpoint(**properties)
new(condition:Adw.BreakpointCondition) -> Adw.Breakpoint

Constructors

class Breakpoint
classmethod new(condition: BreakpointCondition) Breakpoint

Creates a new AdwBreakpoint with condition.

Added in version 1.4.

Parameters:

condition – the condition

Methods

class Breakpoint
add_setter(object: Object, property: str, value: 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 label while icon_name is set will reset the icon. However, resetting the label will not set icon-name to its original value.

Use the apply and unapply signals for those properties instead, as follows:

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);

Added in version 1.4.

Parameters:
  • object – the target object

  • property – the target property

  • value – the value to set

add_setters(objects: Sequence[Object], names: Sequence[str], values: Sequence[Any]) None

Adds multiple setters to self.

See add_setter.

Example:

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);

Added in version 1.4.

Parameters:
  • objects

  • names

  • values

get_condition() BreakpointCondition | None

Gets the condition for self.

Added in version 1.4.

set_condition(condition: BreakpointCondition | None = None) None

Sets the condition for self.

Added in version 1.4.

Parameters:

condition – the new condition

Properties

class Breakpoint
props.condition: BreakpointCondition

The breakpoint’s condition.

Added in version 1.4.

Signals

class Breakpoint.signals
apply() None

Emitted when the breakpoint is applied.

This signal is emitted after the setters have been applied.

Added in version 1.4.

unapply() None

Emitted when the breakpoint is unapplied.

This signal is emitted before resetting the setter values.

Added in version 1.4.