StackSwitcher


Object Hierarchy:

Gtk.StackSwitcher Gtk.StackSwitcher Gtk.StackSwitcher Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.StackSwitcher GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Gtk.StackSwitcher Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.StackSwitcher Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Gtk.StackSwitcher Gtk.ConstraintTarget->Gtk.Widget Gtk.Orientable Gtk.Orientable Gtk.Orientable->Gtk.StackSwitcher

Description:

[ CCode ( type_id = "gtk_stack_switcher_get_type ()" ) ]
public sealed class StackSwitcher : Widget, Accessible, Buildable, ConstraintTarget, Orientable

The `GtkStackSwitcher` shows a row of buttons to switch between `GtkStack` pages.

![An example GtkStackSwitcher](stackswitcher.png)

It acts as a controller for the associated `GtkStack`.

All the content for the buttons comes from the properties of the stacks [class@Gtk.StackPage] 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_accessible_role_tab_list role and uses the gtk_accessible_role_tab for its buttons.

Orientable

Since GTK 4.4, `GtkStackSwitcher` implements `GtkOrientable` allowing the stack switcher to be made vertical with `gtk_orientable_set_orientation()`.


Namespace: Gtk
Package: gtk4

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from interface Gtk.Orientable