Adw.Toggle¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Adw.Toggle(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A toggle within [class`ToggleGroup`].
AdwToggle
can optionally have a name, set with [property`Toggle`:py:data::name<Adw.Toggle.props.name>]. If the name is set, [property`ToggleGroup`:py:data::active-name<Adw.Toggle.props.active_name>] can be used to access toggles instead of index.New in version 1.7.
- classmethod new()¶
- Returns:
the newly created
AdwToggle
- Return type:
Creates a new
AdwToggle
.New in version 1.7.
- get_child()¶
- Returns:
the toggle child
- Return type:
Gtk.Widget
orNone
Gets the child widget of self.
New in version 1.7.
- get_enabled()¶
- Returns:
whether the toggle is enabled
- Return type:
Gets whether self is enabled.
New in version 1.7.
- get_icon_name()¶
-
Gets the icon name of self.
New in version 1.7.
- get_index()¶
- Returns:
the index, or
GTK_INVALID_LIST_POSITION
if it’s not in a group- Return type:
Gets the index of self within its toggle group.
New in version 1.7.
- get_label()¶
-
Gets the label of self.
New in version 1.7.
- get_tooltip()¶
- Returns:
the toggle tooltip
- Return type:
Gets the tooltip of self.
New in version 1.7.
- get_use_underline()¶
- Returns:
whether the toggle uses underlines
- Return type:
Gets whether self uses underlines.
New in version 1.7.
- set_child(child)¶
- Parameters:
child (
Gtk.Widget
orNone
) – a child widget
Sets the child of self to child.
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.
New in version 1.7.
- set_enabled(enabled)¶
- Parameters:
enabled (
bool
) – whether the toggle should be enbled
Sets whether self is enabled.
New in version 1.7.
- set_icon_name(icon_name)¶
-
Sets the icon name of self to icon_name.
The icon will be displayed alone or next to the label, unless [property`Toggle`:py:data::child<Adw.Toggle.props.child>] is set.
New in version 1.7.
- set_label(label)¶
-
Sets the label of self to label.
The label will be displayed alone or next to the icon, unless [property`Toggle`:py:data::child<Adw.Toggle.props.child>] is set, but will still be read out by the screen reader.
New in version 1.7.
- set_name(name)¶
-
Sets the name of self to name.
Allows accessing self by its name instead of index.
See [property`ToggleGroup`:py:data::active-name<Adw.Toggle.props.active_name>].
New in version 1.7.
Property Details¶
- Adw.Toggle.props.child¶
- Name:
child
- Type:
- Default Value:
- Flags:
The toggle child.
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.
New in version 1.7.
- Adw.Toggle.props.enabled¶
- Name:
enabled
- Type:
- Default Value:
- Flags:
Whether this toggle is enabled.
New in version 1.7.
- Adw.Toggle.props.icon_name¶
- Name:
icon-name
- Type:
- Default Value:
- Flags:
The toggle icon name.
The icon will be displayed alone or next to the label, unless [property`Toggle`:py:data::child<Adw.Toggle.props.child>] is set.
New in version 1.7.
- Adw.Toggle.props.label¶
- Name:
label
- Type:
- Default Value:
- Flags:
The toggle label.
The label will be displayed alone or next to the icon, unless [property`Toggle`:py:data::child<Adw.Toggle.props.child>] is set, but will still be read out by the screen reader.
New in version 1.7.
- Adw.Toggle.props.name¶
- Name:
name
- Type:
- Default Value:
- Flags:
The toggle name.
Allows accessing the toggle by its name instead of index.
See [property`ToggleGroup`:py:data::active-name<Adw.Toggle.props.active_name>].
New in version 1.7.
- Adw.Toggle.props.tooltip¶
- Name:
tooltip
- Type:
- Default Value:
''
- Flags:
The tooltip of the toggle.
The tooltip can be marked up with the Pango text markup language.
New in version 1.7.