adw.switch_row

Module for SwitchRow class

Types 3

A gtk.list_box_row.ListBoxRow used to represent two states.

switch-row

The adw.switch_row.SwitchRow widget contains a gtk.switch_.Switch that allows the user to select between two states: "on" or "off". When activated, the row will invert its active state.

The user can control the switch by activating the row or by dragging on the switch handle.

See gtk.switch_.Switch for details.

Example of an adw.switch_row.SwitchRow UI definition:

<object class="AdwSwitchRow">
  <property name="title" translatable="yes">Switch Row</property>
  <signal name="notify::active" handler="switch_row_notify_active_cb"/>
</object>

The adw.switch_row.SwitchRow.active property should be connected to in order to monitor changes to the active state.

Accessibility

adw.switch_row.SwitchRow uses the gtk.types.AccessibleRole.Switch role.

Methods
GType _gType() @property
SwitchRow self()Returns `this`, for use in `with` statements.
SwitchRowGidBuilder builder()Get builder for [adw.switch_row.SwitchRow] Returns: New builder object
bool active() @propertyGet `active` property. Returns: Whether the switch row is in the "on" or "off" position.
void active(bool propval) @propertySet `active` property. Params: propval = Whether the switch row is in the "on" or "off" position.
bool getActive()Gets whether self is in its "on" or "off" position. Returns: whether self is active or not
void setActive(bool isActive)Sets whether self is in its "on" or "off" position
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new [adw.switch_row.SwitchRow]. Returns: the newly created [adw.switch_row.SwitchRow]

Fluent builder implementation template for adw.switch_row.SwitchRow

Methods
T active(bool propval)Set `active` property. Params: propval = Whether the switch row is in the "on" or "off" position. Returns: Builder instance for fluent chaining

Fluent builder for adw.switch_row.SwitchRow

Methods
SwitchRow build()Create object from builder. Returns: New object