1.69 <AdwToggle>

Class: <AdwToggle>

It derives from <GObject>.

A toggle within ToggleGroup.

<AdwToggle> can optionally have a name, set with Toggle:name. If the name is set, ToggleGroup:active-name can be used to access toggles instead of index.

Properties

Property: toggle:child self

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.

Its value is a <GtkWidget>, or #f.

Set it with (set! (toggle:child self) value).

Property: toggle:description self

The description of the toggle.

The description will be read out when using screen reader. If not set, Toggle:tooltip will be used instead.

See Gtk.AccessibleProperty.description.

Its value is a string, or #f.

Set it with (set! (toggle:description self) value).

Property: toggle:enabled self

Whether this toggle is enabled.

Its value is a boolean.

Set it with (set! (toggle:enabled self) value).

Property: toggle:icon-name self

The toggle icon name.

The icon will be displayed alone or next to the label, unless Toggle:child is set.

Its value is a string, or #f.

Set it with (set! (toggle:icon-name self) value).

Property: toggle:label self

The toggle label.

The label will be displayed alone or next to the icon, unless Toggle:child is set, but will still be read out by the screen reader.

Its value is a string, or #f.

Set it with (set! (toggle:label self) value).

Property: toggle:name self

The toggle name.

Allows accessing the toggle by its name instead of index.

See ToggleGroup:active-name.

Its value is a string, or #f.

Set it with (set! (toggle:name self) value).

Property: toggle:tooltip self

The tooltip of the toggle.

The tooltip can be marked up with the Pango text markup language.

Tooltip text will also be used as accessible description. Use Toggle:description to set it separately.

Its value is a string, or #f.

Set it with (set! (toggle:tooltip self) value).

Property: toggle:use-underline self

Whether an embedded underline in the label indicates a mnemonic.

See Toggle:label.

Its value is a boolean.

Set it with (set! (toggle:use-underline self) value).

Procedures

Method: toggle:get-child self ⇒ %return
Method: get-child self ⇒ %return

Gets the child widget of self.

self

Passed: a <AdwToggle>.

a toggle

%return

Returned: a <GtkWidget>, or #f.

the toggle child

Method: toggle:get-description self ⇒ %return
Method: get-description self ⇒ %return

Gets the description of self.

self

Passed: a <AdwToggle>.

a toggle

%return

Returned: a string.

the toggle description

Method: toggle:get-enabled? self ⇒ %return
Method: get-enabled? self ⇒ %return

Gets whether self is enabled.

self

Passed: a <AdwToggle>.

a toggle

%return

Returned: a boolean.

whether the toggle is enabled

Method: toggle:get-icon-name self ⇒ %return
Method: get-icon-name self ⇒ %return

Gets the icon name of self.

self

Passed: a <AdwToggle>.

a toggle

%return

Returned: a string, or #f.

the toggle icon name

Method: toggle:get-index self ⇒ %return
Method: get-index self ⇒ %return

Gets the index of self within its toggle group.

self

Passed: a <AdwToggle>.

a toggle

%return

Returned: an unsigned 32-bit integer.

the index, or Gtk.INVALID_LIST_POSITION if it’s not in a group

Method: toggle:get-label self ⇒ %return
Method: get-label self ⇒ %return

Gets the label of self.

self

Passed: a <AdwToggle>.

a toggle

%return

Returned: a string, or #f.

the toggle label

Method: toggle:get-name self ⇒ %return
Method: get-name self ⇒ %return

Gets the name of self.

self

Passed: a <AdwToggle>.

a toggle

%return

Returned: a string.

the toggle name

Method: toggle:get-tooltip self ⇒ %return
Method: get-tooltip self ⇒ %return

Gets the tooltip of self.

self

Passed: a <AdwToggle>.

a toggle

%return

Returned: a string.

the toggle tooltip

Method: toggle:get-use-underline? self ⇒ %return
Method: get-use-underline? self ⇒ %return

Gets whether self uses underlines.

self

Passed: a <AdwToggle>.

a toggle

%return

Returned: a boolean.

whether the toggle uses underlines

Procedure: toggle:new ⇒ %return

Creates a new <AdwToggle>.

%return

Returned: a <AdwToggle>.

the newly created <AdwToggle>

Method: toggle:set-child self [child]
Method: set-child self [child]

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.

self

Passed: a <AdwToggle>.

a toggle

child

Passed, or left out: a <GtkWidget>, or #f.

a child widget

Method: toggle:set-description self description
Method: set-description self description

Sets the description of self to description.

The description will be read out when using screen reader. If not set, Toggle:tooltip will be used instead.

See Gtk.AccessibleProperty.description.

self

Passed: a <AdwToggle>.

a toggle

description

Passed: a string.

the description

Method: toggle:set-enabled self enabled
Method: set-enabled self enabled

Sets whether self is enabled.

self

Passed: a <AdwToggle>.

a toggle

enabled

Passed: a boolean.

whether the toggle should be enbled

Method: toggle:set-icon-name self [icon-name]
Method: set-icon-name self [icon-name]

Sets the icon name of self to icon-name.

The icon will be displayed alone or next to the label, unless Toggle:child is set.

self

Passed: a <AdwToggle>.

a toggle

icon-name

Passed, or left out: a string, or #f.

the icon name

Method: toggle:set-label self [label]
Method: set-label self [label]

Sets the label of self to label.

The label will be displayed alone or next to the icon, unless Toggle:child is set, but will still be read out by the screen reader.

self

Passed: a <AdwToggle>.

a toggle

label

Passed, or left out: a string, or #f.

a label

Method: toggle:set-name self [name]
Method: set-name self [name]

Sets the name of self to name.

Allows accessing self by its name instead of index.

See ToggleGroup:active-name.

self

Passed: a <AdwToggle>.

a toggle

name

Passed, or left out: a string, or #f.

a name

Method: toggle:set-tooltip self tooltip
Method: set-tooltip self tooltip

Sets the tooltip of self to tooltip.

tooltip can be marked up with the Pango text markup language.

Tooltip text will also be used as accessible description. Use Toggle:description to set it separately.

self

Passed: a <AdwToggle>.

a toggle

tooltip

Passed: a string.

the tooltip

Method: toggle:set-use-underline self use-underline
Method: set-use-underline self use-underline

Sets whether an embedded underline in the label indicates a mnemonic.

See Toggle:label.

self

Passed: a <AdwToggle>.

a toggle

use-underline

Passed: a boolean.

whether an underline in the label indicates a mnemonic