Gnome::Gtk4::StackSwitcher
Description
The Gnome::Gtk4::StackSwitcher shows a row of buttons to switch between Gnome::Gtk4::Stack pages.
It acts as a controller for the associated Gnome::Gtk4::Stack.
All the content for the buttons comes from the properties of the stacks Gnome::Gtk4::StackPage objects; the button visibility in a Gnome::Gtk4::StackSwitcher widget is controlled by the visibility of the child in the Gnome::Gtk4::Stack.
It is possible to associate multiple Gnome::Gtk4::StackSwitcher widgets with the same Gnome::Gtk4::Stack widget.
CSS nodes
Gnome::Gtk4::StackSwitcher has a single CSS node named stackswitcher and style class .stack-switcher.
When circumstances require it, Gnome::Gtk4::StackSwitcher adds the .needs-attention style class to the widgets representing the stack pages.
Accessibility
Gnome::Gtk4::StackSwitcher uses the GTK_ACCESSIBLE_ROLE_TAB_LIST
role and uses the GTK_ACCESSIBLE_ROLE_TAB
for its buttons.
Orientable
Since GTK 4.4, Gnome::Gtk4::StackSwitcher implements Gnome::Gtk4::R-Orientable allowing the stack switcher to be made vertical with gtk_orientable_set_orientation()`.
Class initialization
new
:native-object
Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object :$native-object! )
new-stackswitcher
Create a new Gnome::Gtk4::StackSwitcher.
method new-stackswitcher ( --> Gnome::Gtk4::StackSwitcher \)
Methods
get-stack
Retrieves the stack.
method get-stack (--> N-Object )
Return value; the stack.
set-stack
Sets the stack to control.
method set-stack ( N-Object() $stack )
$stack; a Gnome::Gtk4::Stack.