Class StackSidebar

All Implemented Interfaces:
Accessible, Buildable, ConstraintTarget, Proxy

@Generated("org.javagi.JavaGI") public class StackSidebar extends Widget implements Accessible, Buildable, ConstraintTarget

Uses a sidebar to switch between GtkStack pages.

An example GtkStackSidebar

In order to use a GtkStackSidebar, you simply use a GtkStack to organize your UI flow, and add the sidebar to your sidebar area. You can use setStack(Stack) to connect the GtkStackSidebar to the GtkStack.

CSS nodes

GtkStackSidebar has a single CSS node with name stacksidebar and style class .sidebar.

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

  • Constructor Details

    • StackSidebar

      public StackSidebar(MemorySegment address)
      Create a StackSidebar instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • StackSidebar

      public StackSidebar()
      Create a new StackSidebar.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the StackSidebar class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected StackSidebar asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Widget
      Returns:
      the instance as if it were its parent type
    • getStack

      public @Nullable Stack getStack()
      Retrieves the stack.
      Returns:
      the associated GtkStack or null if none has been set explicitly
    • setStack

      public void setStack(Stack stack)

      Set the GtkStack associated with this GtkStackSidebar.

      The sidebar widget will automatically update according to the order and items within the given GtkStack.

      Parameters:
      stack - a GtkStack
    • builder

      public static StackSidebar.Builder<? extends StackSidebar.Builder> builder()
      A StackSidebar.Builder object constructs a StackSidebar with the specified properties. Use the various set...() methods to set properties, and finish construction with StackSidebar.Builder.build().
      Returns:
      the builder object