Shows a row of buttons to switch between GtkStack pages.
<picture> <source srcset="stackswitcher-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An example GtkStackSwitcher" src="stackswitcher.png"> </picture> It acts as a controller for the associated GtkStack.
All the content for the buttons comes from the properties of the stacks [classGtk.StackPage] objects; the button visibility in a GtkStackSwitcher widget is controlled by the visibility of the child in the GtkStack.
It is possible to associate multiple GtkStackSwitcher widgets with the same GtkStack widget.
# CSS nodes
GtkStackSwitcher has a single CSS node named stackswitcher and style class .stack-switcher.
When circumstances require it, GtkStackSwitcher adds the .needs-attention style class to the widgets representing the stack pages.
# Accessibility
GtkStackSwitcher uses the [enumGtk.AccessibleRole.tab_list] role and uses the [enumGtk.AccessibleRole.tab] role for its buttons.
# Orientable
Since GTK 4.4, GtkStackSwitcher implements GtkOrientable allowing the stack switcher to be made vertical with gtk_orientable_set_orientation.
<group>Layout containers</group> <gtkada_demo>create_stack.adb</gtkada_demo>
function "+"
(Widget : access Gtk_Stack_Switcher_Record'Class)
return Gtk.Accessible.Gtk_Accessible
function "+"
(Widget : access Gtk_Stack_Switcher_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Stack_Switcher_Record'Class)
return Gtk.Constraint_Target.Gtk_Constraint_Target
function "+"
(Widget : access Gtk_Stack_Switcher_Record'Class)
return Gtk.Orientable.Gtk_Orientable
function "-"
(Interf : Gtk.Accessible.Gtk_Accessible)
return Gtk_Stack_Switcher
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Stack_Switcher
function "-"
(Interf : Gtk.Constraint_Target.Gtk_Constraint_Target)
return Gtk_Stack_Switcher
function "-"
(Interf : Gtk.Orientable.Gtk_Orientable)
return Gtk_Stack_Switcher
procedure Announce
(Self : not null access Gtk_Stack_Switcher_Record;
Message : UTF8_String;
Priority : Gtk.Accessible.Gtk_Accessible_Announcement_Priority)
function Get_Accessible_Id
(Self : not null access Gtk_Stack_Switcher_Record) return UTF8_String
function Get_Accessible_Parent
(Self : not null access Gtk_Stack_Switcher_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Accessible_Role
(Self : not null access Gtk_Stack_Switcher_Record)
return Gtk.Accessible.Gtk_Accessible_Role
function Get_At_Context
(Self : not null access Gtk_Stack_Switcher_Record)
return Gtk.Atcontext.Gtk_Atcontext
function Get_Bounds
(Self : not null access Gtk_Stack_Switcher_Record;
X : out Glib.Gint;
Y : out Glib.Gint;
Width : out Glib.Gint;
Height : out Glib.Gint) return Boolean
function Get_First_Accessible_Child
(Self : not null access Gtk_Stack_Switcher_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Next_Accessible_Sibling
(Self : not null access Gtk_Stack_Switcher_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Orientation
(Self : not null access Gtk_Stack_Switcher_Record)
return Gtk.Enums.Gtk_Orientation
function Get_Platform_State
(Self : not null access Gtk_Stack_Switcher_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State) return Boolean
function Get_Stack
(Self : not null access Gtk_Stack_Switcher_Record)
return Gtk.Stack.Gtk_Stack
Retrieves the stack.
the stack. Has transfer-ownership='none'.
function Get_Type return Glib.GType
procedure Gtk_New (Self : out Gtk_Stack_Switcher)
Create a new GtkStackSwitcher. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
type Gtk_Stack_Switcher is access all Gtk_Stack_Switcher_Record'Class;
function Gtk_Stack_Switcher_New return Gtk_Stack_Switcher
Create a new GtkStackSwitcher.
type Gtk_Stack_Switcher_Record is new Gtk_Widget_Record with null record;
package Implements_Gtk_Accessible is new Glib.Types.Implements
(Gtk.Accessible.Gtk_Accessible, Gtk_Stack_Switcher_Record, Gtk_Stack_Switcher);
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Stack_Switcher_Record, Gtk_Stack_Switcher);
package Implements_Gtk_Constraint_Target is new Glib.Types.Implements
(Gtk.Constraint_Target.Gtk_Constraint_Target, Gtk_Stack_Switcher_Record, Gtk_Stack_Switcher);
package Implements_Gtk_Orientable is new Glib.Types.Implements
(Gtk.Orientable.Gtk_Orientable, Gtk_Stack_Switcher_Record, Gtk_Stack_Switcher);
procedure Initialize
(Self : not null access Gtk_Stack_Switcher_Record'Class)
Create a new GtkStackSwitcher. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Reset_Property
(Self : not null access Gtk_Stack_Switcher_Record;
Property : Gtk.Accessible.Gtk_Accessible_Property)
procedure Reset_Relation
(Self : not null access Gtk_Stack_Switcher_Record;
Relation : Gtk.Accessible.Gtk_Accessible_Relation)
procedure Reset_State
(Self : not null access Gtk_Stack_Switcher_Record;
State : Gtk.Accessible.Gtk_Accessible_State)
procedure Set_Accessible_Parent
(Self : not null access Gtk_Stack_Switcher_Record;
Parent : Gtk.Accessible.Gtk_Accessible;
Next_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Set_Orientation
(Self : not null access Gtk_Stack_Switcher_Record;
Orientation : Gtk.Enums.Gtk_Orientation)
procedure Set_Stack
(Self : not null access Gtk_Stack_Switcher_Record;
Stack : access Gtk.Stack.Gtk_Stack_Record'Class)
Sets the stack to control.
a GtkStack
Stack_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Stack.Gtk_Stack The stack.
procedure Update_Next_Accessible_Sibling
(Self : not null access Gtk_Stack_Switcher_Record;
New_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Update_Platform_State
(Self : not null access Gtk_Stack_Switcher_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State)