Toggle#
Added in version 1.7.
Superclasses: Object
A toggle within ToggleGroup.
AdwToggle can optionally have a name, set with name.
If the name is set, active_name can be used to access
toggles instead of index.
Constructors#
Methods#
- class Toggle
-
- set_child(child: Widget | None = None) None#
Sets the child of
selftochild.When the child is set, icon and label are not displayed.
It’s recommended to still set the label, as it can still be used by the screen reader.
Added in version 1.7.
- Parameters:
child – a child widget
- set_description(description: str) None#
Sets the description of
selftodescription.The description will be read out when using screen reader. If not set,
tooltipwill be used instead.See
description.Added in version 1.9.
- Parameters:
description – the description
- set_enabled(enabled: bool) None#
Sets whether
selfis enabled.Added in version 1.7.
- Parameters:
enabled – whether the toggle should be enbled
- set_icon_name(icon_name: str | None = None) None#
Sets the icon name of
selftoicon_name.The icon will be displayed alone or next to the label, unless
childis set.Added in version 1.7.
- Parameters:
icon_name – the icon name
- set_label(label: str | None = None) None#
Sets the label of
selftolabel.The label will be displayed alone or next to the icon, unless
childis set, but will still be read out by the screen reader.Added in version 1.7.
- Parameters:
label – a label
- set_name(name: str | None = None) None#
Sets the name of
selftoname.Allows accessing
selfby its name instead of index.See
active_name.Added in version 1.7.
- Parameters:
name – a name
- set_tooltip(tooltip: str) None#
Sets the tooltip of
selftotooltip.tooltipcan be marked up with the Pango text markup language.Tooltip text will also be used as accessible description. Use
descriptionto set it separately.Added in version 1.7.
- Parameters:
tooltip – the tooltip
Properties#
- class Toggle