gtk.stack_switcher

Module for StackSwitcher class

Types 3

The gtk.stack_switcher.StackSwitcher shows a row of buttons to switch between gtk.stack.Stack pages.

!An example GtkStackSwitcher

It acts as a controller for the associated gtk.stack.Stack.

All the content for the buttons comes from the properties of the stacks gtk.stack_page.StackPage objects; the button visibility in a gtk.stack_switcher.StackSwitcher widget is controlled by the visibility of the child in the gtk.stack.Stack.

It is possible to associate multiple gtk.stack_switcher.StackSwitcher widgets with the same gtk.stack.Stack widget.

CSS nodes

gtk.stack_switcher.StackSwitcher has a single CSS node named stackswitcher and style class .stack-switcher.

When circumstances require it, gtk.stack_switcher.StackSwitcher adds the .needs-attention style class to the widgets representing the stack pages.

Accessibility

gtk.stack_switcher.StackSwitcher uses the gtk.types.AccessibleRole.TabList role and uses the gtk.types.AccessibleRole.Tab for its buttons.

Orientable

Since GTK 4.4, gtk.stack_switcher.StackSwitcher implements gtk.orientable.Orientable allowing the stack switcher to be made vertical with [gtk.orientable.Orientable.setOrientation].

Methods
GType _gType() @property
StackSwitcher self()Returns `this`, for use in `with` statements.
StackSwitcherGidBuilder builder()Get builder for [gtk.stack_switcher.StackSwitcher] Returns: New builder object
gtk.stack.Stack stack() @propertyGet `stack` property. Returns: The stack.
void stack(gtk.stack.Stack propval) @propertySet `stack` property. Params: propval = The stack.
gtk.stack.Stack getStack()Retrieves the stack. Returns: the stack
void setStack(gtk.stack.Stack stack = null)Sets the stack to control.
Constructors
this(void * ptr, Flag!"Take" take)
this()Create a new [gtk.stack_switcher.StackSwitcher]. Returns: a new [gtk.stack_switcher.StackSwitcher].

Fluent builder implementation template for gtk.stack_switcher.StackSwitcher

Methods
T stack(gtk.stack.Stack propval)Set `stack` property. Params: propval = The stack. Returns: Builder instance for fluent chaining
Methods
StackSwitcher build()Create object from builder. Returns: New object