gtk.stack

Module for [Stack] class

Types 3

The GtkStack widget 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, the #GtkStackSwitcher widget can be used with GtkStack to provide this functionality.

Transitions between pages can be animated as slides or fades. This can be controlled with [gtk.stack.Stack.setTransitionType]. These animations respect the #GtkSettings:gtk-enable-animations setting.

The GtkStack widget was added in GTK+ 3.10.

CSS nodes

GtkStack has a single CSS node named stack.

Methods
GType _gType() @property
Stack self()Returns `this`, for use in `with` statements.
StackGidBuilder builder()Get builder for [gtk.stack.Stack] Returns: New builder object
bool hhomogeneous() @propertyGet `hhomogeneous` property. Returns: true if the stack allocates the same width for all children.
void hhomogeneous(bool propval) @propertySet `hhomogeneous` property. Params: propval = true if the stack allocates the same width for all children.
bool homogeneous() @property
void homogeneous(bool propval) @property
bool interpolateSize() @property
void interpolateSize(bool propval) @property
uint transitionDuration() @property
void transitionDuration(uint propval) @property
bool transitionRunning() @property
bool vhomogeneous() @propertyGet `vhomogeneous` property. Returns: true if the stack allocates the same height for all children.
void vhomogeneous(bool propval) @propertySet `vhomogeneous` property. Params: propval = true if the stack allocates the same height for all children.
void visibleChild(gtk.widget.Widget propval) @property
string visibleChildName() @property
void visibleChildName(string propval) @property
void addNamed(gtk.widget.Widget child, string name)Adds a child to stack. The child is identified by the name.
void addTitled(gtk.widget.Widget child, string name, string title)Adds a child to stack. 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.
gtk.widget.Widget getChildByName(string name)Finds the child of the #GtkStack with the name given as the argument. Returns null if there is no child with this name.
bool getHhomogeneous()Gets whether stack is horizontally homogeneous. See [gtk.stack.Stack.setHhomogeneous]. Returns: whether stack is horizontally homogeneous.
bool getHomogeneous()Gets whether stack is homogeneous. See [gtk.stack.Stack.setHomogeneous]. Returns: whether stack is homogeneous.
bool getInterpolateSize()Returns wether the #GtkStack is set up to interpolate between the sizes of children on page switch. Returns: true if child sizes are interpolated
uint getTransitionDuration()Returns the amount of time (in milliseconds) that transitions between pages in stack will take. Returns: the transition duration
bool getTransitionRunning()Returns whether the stack is currently in a transition from one page to another. Returns: true if the transition is currently running, false otherwise.
gtk.types.StackTransitionType getTransitionType()Gets the type of animation that will be used for transitions between pages in stack. Returns: the current transition type of stack
bool getVhomogeneous()Gets whether stack is vertically homogeneous. See [gtk.stack.Stack.setVhomogeneous]. Returns: whether stack is vertically homogeneous.
gtk.widget.Widget getVisibleChild()Gets the currently visible child of stack, or null if there are no visible children. Returns: the visible child of the #GtkStack
string getVisibleChildName()Returns the name of the currently visible child of stack, or null if there is no visible child. Returns: the name of the visible child of the #GtkStack
void setHhomogeneous(bool hhomogeneous)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 differ...
void setHomogeneous(bool homogeneous)Sets the #GtkStack to be homogeneous or not. If it is homogeneous, the #GtkStack will request the same size for all its children. If it isn't, the stack may change size when a different child becom...
void setInterpolateSize(bool interpolateSize)Sets whether or not stack will interpolate its size when changing the visible child. If the #GtkStack:interpolate-size property is set to true, stack will interpolate its size between the current o...
void setTransitionDuration(uint duration)Sets the duration that transitions between pages in stack will take.
void setTransitionType(gtk.types.StackTransitionType transition)Sets the type of animation that will be used for transitions between pages in stack. Available types include various kinds of fades and slides.
void setVhomogeneous(bool vhomogeneous)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 differ...
void setVisibleChild(gtk.widget.Widget child)Makes child the visible child of stack.
void setVisibleChildFull(string name, gtk.types.StackTransitionType transition)Makes the child with the given name visible.
void setVisibleChildName(string name)Makes the child with the given name visible.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new #GtkStack container. Returns: a new #GtkStack
Methods
T hhomogeneous(bool propval)Set `hhomogeneous` property. Params: propval = true if the stack allocates the same width for all children. Returns: Builder instance for fluent chaining
T homogeneous(bool propval)
T interpolateSize(bool propval)
T transitionDuration(uint propval)
T vhomogeneous(bool propval)Set `vhomogeneous` property. Params: propval = true if the stack allocates the same height for all children. Returns: Builder instance for fluent chaining
T visibleChildName(string propval)

Fluent builder for [gtk.stack.Stack]

Methods