Gtk.Stack (original) (raw)

Class

GtkStack

Description [src]

final class Gtk.Stack : Gtk.Widget
  implements Gtk.Accessible, Gtk.Buildable, Gtk.ConstraintTarget {
  /* No available fields */
}

Shows one of its children at a time.

An example GtkStack

In contrast to GtkNotebook, GtkStack does not provide a means for users to change the visible child. Instead, a separate widget such as GtkStackSwitcher or GtkStackSidebar 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_set_transition_type(). These animations respect the GtkSettings:gtk-enable-animations setting.

GtkStack maintains a GtkStackPage object for each added child, which holds additional per-child properties. You obtain the GtkStackPage for a child with gtk_stack_get_page()and you can obtain a GtkSelectionModel containing all the pages with gtk_stack_get_pages().

GtkStack as GtkBuildable

To set child-specific properties in a .ui file, create GtkStackPageobjects explicitly, and set the child widget as a property on it:

<object class="GtkStack" id="stack"> <child> <object class="GtkStackPage"> <property name="name">page1</property> <property name="title">In the beginning…</property> <property name="child"> <object class="GtkLabel"> <property name="label">It was dark</property> </object> </property> </object> </child>

CSS nodes

GtkStack has a single CSS node named stack.

Accessibility

GtkStack uses the GTK_ACCESSIBLE_ROLE_TAB_PANEL role for the stack pages, which are the accessible parent objects of the child widgets.

Constructors

Instance methods

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.