It derives from <GtkWidget>.
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
<GtkStackSwitcher> or
<GtkStackSidebar> can be used with
<GtkStack> to provide this functionality.
Transitions between pages can be animated as slides or fades. This can
be controlled with stack:set-transition-type. These animations
respect the settings:gtk-enable-animations setting.
<GtkStack> maintains a
<GtkStackPage> object for each added child,
which holds additional per-child properties. You obtain the
<GtkStackPage> for a child with stack:get-page and you can obtain a
<GtkSelectionModel> containing all the
pages with stack:get-pages.
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>
<GtkStack> has a single CSS node named stack.
<GtkStack> uses the
Gtk.AccessibleRole.tab_panel role for the stack pages, which are
the accessible parent objects of the child widgets.
#t if the stack allocates the same width for all children.
Its value is a boolean.
Set it with (set! (stack:hhomogeneous self) value).
Whether or not the size should smoothly change during the transition.
Its value is a boolean.
Set it with (set! (stack:interpolate-size self) value).
A selection model with the stack pages.
Its value is a <GtkSelectionModel>, or
#f.
It is read only.
The animation duration, in milliseconds.
Its value is an unsigned 32-bit integer.
Set it with (set! (stack:transition-duration self) value).
Whether or not the transition is currently running.
Its value is a boolean.
It is read only.
The type of animation used to transition.
Its value is a
<GtkStackTransitionType> (or, to set
it, one of its symbols).
Set it with (set! (stack:transition-type self) value).
#t if the stack allocates the same height for all children.
Its value is a boolean.
Set it with (set! (stack:vhomogeneous self) value).
The widget currently visible in the stack.
Its value is a <GtkWidget>, or #f.
Set it with (set! (stack:visible-child self) value).
The name of the widget currently visible in the stack.
Its value is a string, or #f.
Set it with (set! (stack:visible-child-name self) value).
Adds a child to self.
Passed: a <GtkStack>.
Passed: a <GtkWidget>.
the widget to add
Returned: a <GtkStackPage>.
the <GtkStackPage> for child
Adds a child to self.
The child is identified by the name.
Passed: a <GtkStack>.
Passed: a <GtkWidget>.
the widget to add
Passed, or left out: a string, or #f.
the name for child
Returned: a <GtkStackPage>.
the <GtkStackPage> for child
Adds a child to self.
The child is identified by the name. The title will be used
by <GtkStackSwitcher> to represent
child in a tab bar, so it should be short.
Passed: a <GtkStack>.
Passed: a <GtkWidget>.
the widget to add
Passed: a string, or #f.
the name for child
Passed: a string.
a human-readable title for child
Returned: a <GtkStackPage>.
the <GtkStackPage> for child
Finds the child with the name given as the argument.
Returns #f if there is no child with this name.
Passed: a <GtkStack>.
Passed: a string.
the name of the child to find
Returned: a <GtkWidget>, or #f.
the requested child of the <GtkStack>
Gets whether self is horizontally homogeneous.
Passed: a <GtkStack>.
Returned: a boolean.
whether self is horizontally homogeneous.
Returns whether the <GtkStack> is set up to
interpolate between the sizes of children on page switch.
Passed: a <GtkStack>.
Returned: a boolean.
#t if child sizes are interpolated
Returns the <GtkStackPage> object for
child.
Passed: a <GtkStack>.
Passed: a <GtkWidget>.
a child of self
Returned: a <GtkStackPage>.
the <GtkStackPage> for child
Returns a <GListModel> that contains the
pages of the stack.
This can be used to keep an up-to-date view. The model also implements
<GtkSelectionModel> and can be used to
track and modify the visible page.
Passed: a <GtkStack>.
Returned: a <GtkSelectionModel>.
a <GtkSelectionModel> for the stack’s
children
Returns the amount of time (in milliseconds) that transitions between pages in self will take.
Passed: a <GtkStack>.
Returned: an unsigned 32-bit integer.
the transition duration
Returns whether the self is currently in a transition from one page to another.
Passed: a <GtkStack>.
Returned: a boolean.
#t if the transition is currently running, #f otherwise.
Gets the type of animation that will be used for transitions between pages in self.
Passed: a <GtkStack>.
Returned: a <GtkStackTransitionType>.
the current transition type of self
Gets whether self is vertically homogeneous.
Passed: a <GtkStack>.
Returned: a boolean.
whether self is vertically homogeneous.
Gets the currently visible child of self.
Returns #f if there are no visible children.
Passed: a <GtkStack>.
Returned: a <GtkWidget>, or #f.
the visible child of the <GtkStack>
Returns the name of the currently visible child of self.
Returns #f if there is no visible child.
Passed: a <GtkStack>.
Returned: a string, or #f.
the name of the visible child of the <GtkStack>
Creates a new <GtkStack>.
Returned: a <GtkWidget>.
a new <GtkStack>
Removes a child widget from self.
Passed: a <GtkStack>.
Passed: a <GtkWidget>.
the child to remove
Sets the <GtkStack> to be horizontally homogeneous
or not.
If it is homogeneous, the <GtkStack> will request
the same width for all its children. If it isn’t, the stack may change
width when a different child becomes visible.
Passed: a <GtkStack>.
Passed: a boolean.
#t to make self horizontally homogeneous
Sets whether or not self will interpolate its size when changing the visible child.
If the stack:interpolate-size property is set to #t,
self will interpolate its size between the current one and the one
it’ll take after changing the visible child, according to the set
transition duration.
Passed: a <GtkStack>.
Passed: a boolean.
the new value
Sets the duration that transitions between pages in self will take.
Passed: a <GtkStack>.
Passed: an unsigned 32-bit integer.
the new duration, in milliseconds
Sets the type of animation that will be used for transitions between pages in self.
Available types include various kinds of fades and slides.
The transition type can be changed without problems at runtime, so it is possible to change the animation based on the page that is about to become current.
Passed: a <GtkStack>.
Passed: a <GtkStackTransitionType>, or
one of its symbols.
the new transition type
Sets the <GtkStack> to be vertically homogeneous or
not.
If it is homogeneous, the <GtkStack> will request
the same height for all its children. If it isn’t, the stack may change
height when a different child becomes visible.
Passed: a <GtkStack>.
Passed: a boolean.
#t to make self vertically homogeneous
Makes child the visible child of self.
If child is different from the currently visible child, the transition between the two will be animated with the current transition type of self.
Note that the child widget has to be visible itself (see
widget:show) in order to become the visible
child of self.
Passed: a <GtkStack>.
Passed: a <GtkWidget>.
a child of self
Makes the child with the given name visible.
Note that the child widget has to be visible itself (see
widget:show) in order to become the visible
child of self.
Passed: a <GtkStack>.
Passed: a string.
the name of the child to make visible
Passed: a <GtkStackTransitionType>, or
one of its symbols.
the transition type to use
Makes the child with the given name visible.
If child is different from the currently visible child, the transition between the two will be animated with the current transition type of self.
Note that the child widget has to be visible itself (see
widget:show) in order to become the visible
child of self.
Passed: a <GtkStack>.
Passed: a string.
the name of the child to make visible