:right-sidebar: True StackSidebar =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: StackSidebar(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` A ``GtkStackSidebar`` uses a sidebar to switch between ``GtkStack`` pages. In order to use a ``GtkStackSidebar``, you simply use a ``GtkStack`` to organize your UI flow, and add the sidebar to your sidebar area. You can use :obj:`~gi.repository.Gtk.StackSidebar.set_stack` to connect the ``GtkStackSidebar`` to the ``GtkStack``. CSS nodes --------- ``GtkStackSidebar`` has a single CSS node with name stacksidebar and style class .sidebar. When circumstances require it, ``GtkStackSidebar`` adds the .needs-attention style class to the widgets representing the stack pages. Constructors ------------ .. rst-class:: interim-class .. class:: StackSidebar :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``GtkStackSidebar``. Methods ------- .. rst-class:: interim-class .. class:: StackSidebar :no-index: .. method:: get_stack() -> ~gi.repository.Gtk.Stack | None Retrieves the stack. .. method:: set_stack(stack: ~gi.repository.Gtk.Stack) -> None Set the ``GtkStack`` associated with this ``GtkStackSidebar``. The sidebar widget will automatically update according to the order and items within the given ``GtkStack``. :param stack: a ``GtkStack`` Properties ---------- .. rst-class:: interim-class .. class:: StackSidebar :no-index: .. attribute:: props.stack :type: ~gi.repository.Gtk.Stack The stack.