Package org.gnome.gtk

Class Stack

java.lang.Object
All Implemented Interfaces:
Proxy, Accessible, Buildable, ConstraintTarget

@Generated("io.github.jwharm.JavaGI") public class Stack extends Widget implements Accessible, Buildable, ConstraintTarget
GtkStack is a container which only shows one of its children at a time.

In contrast to GtkNotebook, GtkStack does not provide a means for users to change the visible child. Instead, a separate widget such as StackSwitcher or StackSidebar can be used with GtkStack to provide this functionality.

Transitions between pages can be animated as slides or fades. This can be controlled with setTransitionType(org.gnome.gtk.StackTransitionType). These animations respect the Gtk.Settings:gtk-enable-animations setting.

GtkStack maintains a StackPage object for each added child, which holds additional per-child properties. You obtain the GtkStackPage for a child with getPage(org.gnome.gtk.Widget) and you can obtain a GtkSelectionModel containing all the pages with getPages().

GtkStack as GtkBuildable
To set child-specific properties in a .ui file, create GtkStackPage objects explicitly, and set the child widget as a property on it:

  <object class="GtkStack" id="stack">
     <child>
       <object class="GtkStackPage">
         <property name="name">page1</property>
         <property name="title">In the beginning…</property>
         <property name="child">
           <object class="GtkLabel">
             <property name="label">It was dark</property>
           </object>
         </property>
       </object>
     </child>
 

CSS nodes
GtkStack has a single CSS node named stack.

Accessibility
GtkStack uses the AccessibleRole.TAB_PANEL for the stack pages, which are the accessible parent objects of the child widgets.