Stack#
- class ignis.widgets.Stack(*args: Any, **kwargs: Any)#
Bases:
Gtk.Stack
Stack is a container which only shows one of its children at a time.
It does not provide a means for users to change the visible child. Instead, a separate widget such as
StackSwitcher
can be used with Stack to provide this functionality.- Parameters:
**kwargs -- Properties to set.
- Overrided properties:
transition_type: The type of animation used to transition between pages. Available values:
Gtk.StackTransitionType
.
from ignis import widgets stack = widgets.Stack( child=[ widgets.StackPage( title="page 1", child=widgets.Label(label="welcome to page 1!") ), widgets.StackPage( title="page 2", child=widgets.Label(label="welcome to page 2!") ), widgets.StackPage( title="page 3", child=widgets.Label(label="welcome to page 3!") ), ] ) widgets.Box( vertical=True, # you should add both StackSwitcher and Stack. child=[widgets.StackSwitcher(stack=stack), stack], )
- class ignis.widgets.StackPage(title: str, child: gi.repository.Gtk.Widget)#
Bases:
IgnisGObject
Intented to use with
Stack
.- Parameters:
title (
str
) -- The title. It will be used byStackSwitcher
to displaychild
in a tab bar.child (
Widget
) -- The child widget.
Warning
It is not a widget.
- gproperty title: str#
read-only
The title. It will be used by
StackSwitcher
to displaychild
in a tab bar.
- gproperty child: gi.repository.Gtk.Widget#
read-only
The child widget.
- class ignis.widgets.StackSwitcher(*args: Any, **kwargs: Any)#
Bases:
Gtk.StackSwitcher
The StackSwitcher shows a row of buttons to switch between
Stack
pages.- Parameters:
**kwargs -- Properties to set.