Class StackSwitcher

All Implemented Interfaces:
PointerInterface

public class StackSwitcher extends Widget
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()`.

https://docs.gtk.org/gtk4/class.StackSwitcher.html

  • Constructor Details

    • StackSwitcher

      public StackSwitcher(PointerContainer pointer)
    • StackSwitcher

      public StackSwitcher()
      Create a new `GtkStackSwitcher`.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getStack

      public Stack getStack()
      Retrieves the stack.
      Returns:
      the stack
    • setStack

      public void setStack(@Nullable Stack stack)
      Sets the stack to control.
      Parameters:
      stack - a `GtkStack`
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Widget
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Widget
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      Returns:
      ConstraintTarget
    • asOrientable

      public Orientable asOrientable()
      Implements interface Orientable. Call this to get access to interface functions.
      Returns:
      Orientable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()