Stack package:gi-gtk

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 stackSetTransitionType. These animations respect the Settings:gtkEnableAnimations setting. GtkStack maintains a StackPage object for each added child, which holds additional per-child properties. You obtain the GtkStackPage for a child with stackGetPage and you can obtain a GtkSelectionModel containing all the pages with stackGetPages.

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:

xml code

<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 AccessibleRoleTabPanel for the stack pages, which are the accessible parent objects of the child widgets.
Memory-managed wrapper type.
Possible transitions between pages in a GtkStack widget. New values may be added to this enumeration over time.
A cross-fade
No transition
Cover the old page by sliding down
Cover the old page sliding down or uncover the new page sliding up, according to order
Cover the old page by sliding to the left
Cover the old page sliding left or uncover the new page sliding right, according to order
Cover the old page by sliding to the right
Cover the old page sliding right or uncover the new page sliding left, according to order
Cover the old page by sliding up
Cover the old page sliding up or uncover the new page sliding down, according to order
Pretend the pages are sides of a cube and rotate that cube to the left
Pretend the pages are sides of a cube and rotate that cube to the left or right according to the children order
Pretend the pages are sides of a cube and rotate that cube to the right
Slide from top down
Slide from right to left
Slide from left or right according to the children order
Slide from left to right
Slide from bottom up
Slide from top down or bottom up according to the order
Uncover the new page by sliding down
Uncover the new page by sliding to the left