Package org.gnome.adw

Class ViewStack

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

@Generated("io.github.jwharm.JavaGI") public final class ViewStack extends Widget implements Accessible, Buildable, ConstraintTarget
A view container for ViewSwitcher.

AdwViewStack is a container which only shows one page at a time. It is typically used to hold an application's main views.

It doesn't provide a way to transition between pages. Instead, a separate widget such as ViewSwitcher can be used with AdwViewStack to provide this functionality.

AdwViewStack pages can have a title, an icon, an attention request, and a numbered badge that ViewSwitcher will use to let users identify which page is which. Set them using the ViewStackPage:title, ViewStackPage:icon-name, ViewStackPage:needs-attention, and ViewStackPage:badge-number properties.

Unlike Stack, transitions between views are not animated.

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

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

  <object class="AdwViewStack" id="stack">
     <child>
       <object class="AdwViewStackPage">
         <property name="name">overview</property>
         <property name="title">Overview</property>
         <property name="child">
           <object class="AdwStatusPage">
             <property name="title">Welcome!</property>
           </object>
         </property>
       </object>
     </child>
   </object>
 

CSS nodes
AdwViewStack has a single CSS node named stack.

Accessibility
AdwViewStack uses the GTK_ACCESSIBLE_ROLE_TAB_PANEL for the stack pages which are the accessible parent objects of the child widgets.