1.190 <GtkStackSwitcher>

Class: <GtkStackSwitcher>

It derives from <GtkWidget>.

Shows a row of buttons to switch between <GtkStack> pages.

It acts as a controller for the associated <GtkStack>.

All the content for the buttons comes from the properties of the stacks <GtkStackPage> objects; the button visibility in a <GtkStackSwitcher> widget is controlled by the visibility of the child in the <GtkStack>.

It is possible to associate multiple <GtkStackSwitcher> widgets with the same <GtkStack> widget.

CSS nodes

<GtkStackSwitcher> has a single CSS node named stackswitcher and style class .stack-switcher.

When circumstances require it, <GtkStackSwitcher> adds the .needs-attention style class to the widgets representing the stack pages.

Accessibility

<GtkStackSwitcher> uses the Gtk.AccessibleRole.tab_list role and uses the Gtk.AccessibleRole.tab role for its buttons.

Orientable

Since GTK 4.4, <GtkStackSwitcher> implements <GtkOrientable> allowing the stack switcher to be made vertical with orientable:set-orientation.

Properties

Property: stack-switcher:stack self

The stack.

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

Set it with (set! (stack-switcher:stack self) value).

Procedures

Method: stack-switcher:get-stack self ⇒ %return
Method: get-stack self ⇒ %return

Retrieves the stack.

self

Passed: a <GtkStackSwitcher>.

a <GtkStackSwitcher>

%return

Returned: a <GtkStack>, or #f.

the stack

Procedure: stack-switcher:new ⇒ %return

Create a new <GtkStackSwitcher>.

%return

Returned: a <GtkWidget>.

a new <GtkStackSwitcher>.

Method: stack-switcher:set-stack self [stack]
Method: set-stack self [stack]

Sets the stack to control.

self

Passed: a <GtkStackSwitcher>.

a <GtkStackSwitcher>

stack

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

a <GtkStack>