StackProtocol
public protocol StackProtocol : ContainerProtocol
The GtkStack widget is a container which only shows
one of its children at a time. In contrast to GtkNotebook,
GtkStack does not provide a means for users to change the
visible child. Instead, the GtkStackSwitcher widget 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.
The GtkStack widget was added in GTK+ 3.10.
CSS nodes
GtkStack has a single CSS node named stack.
The StackProtocol protocol exposes the methods and properties of an underlying GtkStack instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Stack.
Alternatively, use StackRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkStackinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
stack_ptrDefault implementationTyped pointer to the underlying
GtkStackinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkStackinstance.Declaration
Swift
var stack_ptr: UnsafeMutablePointer<GtkStack>! { get } -
Required Initialiser for types conforming to
StackProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
StackPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: StackPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a Stack property
Declaration
Swift
@inlinable func get(property: StackPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a Stack property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: StackPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
addNamed(child:Extension methodname: ) Adds a child to
stack. The child is identified by thename.Declaration
Swift
@inlinable func addNamed<WidgetT>(child: WidgetT, name: UnsafePointer<gchar>!) where WidgetT : WidgetProtocol -
addTitled(child:Extension methodname: title: ) Adds a child to
stack. The child is identified by thename. Thetitlewill be used byGtkStackSwitcherto representchildin a tab bar, so it should be short.Declaration
Swift
@inlinable func addTitled<WidgetT>(child: WidgetT, name: UnsafePointer<gchar>!, title: UnsafePointer<gchar>!) where WidgetT : WidgetProtocol -
getChildBy(name:Extension method) Finds the child of the
GtkStackwith the name given as the argument. Returnsnilif there is no child with this name.Declaration
Swift
@inlinable func getChildBy(name: UnsafePointer<gchar>!) -> WidgetRef! -
getHhomogeneous()Extension methodGets whether
stackis horizontally homogeneous. Seegtk_stack_set_hhomogeneous().Declaration
Swift
@inlinable func getHhomogeneous() -> Bool -
getHomogeneous()Extension methodGets whether
stackis homogeneous. Seegtk_stack_set_homogeneous().Declaration
Swift
@inlinable func getHomogeneous() -> Bool -
getInterpolateSize()Extension methodReturns wether the
GtkStackis set up to interpolate between the sizes of children on page switch.Declaration
Swift
@inlinable func getInterpolateSize() -> Bool -
getTransitionDuration()Extension methodReturns the amount of time (in milliseconds) that transitions between pages in
stackwill take.Declaration
Swift
@inlinable func getTransitionDuration() -> Int -
getTransitionRunning()Extension methodReturns whether the
stackis currently in a transition from one page to another.Declaration
Swift
@inlinable func getTransitionRunning() -> Bool -
getTransitionType()Extension methodGets the type of animation that will be used for transitions between pages in
stack.Declaration
Swift
@inlinable func getTransitionType() -> GtkStackTransitionType -
getVhomogeneous()Extension methodGets whether
stackis vertically homogeneous. Seegtk_stack_set_vhomogeneous().Declaration
Swift
@inlinable func getVhomogeneous() -> Bool -
getVisibleChild()Extension methodGets the currently visible child of
stack, ornilif there are no visible children.Declaration
Swift
@inlinable func getVisibleChild() -> WidgetRef! -
getVisibleChildName()Extension methodReturns the name of the currently visible child of
stack, ornilif there is no visible child.Declaration
Swift
@inlinable func getVisibleChildName() -> String! -
set(hhomogeneous:Extension method) Sets the
GtkStackto be horizontally homogeneous or not. If it is homogeneous, theGtkStackwill request the same width for all its children. If it isn’t, the stack may change width when a different child becomes visible.Declaration
Swift
@inlinable func set(hhomogeneous: Bool) -
set(homogeneous:Extension method) Sets the
GtkStackto be homogeneous or not. If it is homogeneous, theGtkStackwill request the same size for all its children. If it isn’t, the stack may change size when a different child becomes visible.Since 3.16, homogeneity can be controlled separately for horizontal and vertical size, with the
GtkStack:hhomogeneousandGtkStack:vhomogeneous.Declaration
Swift
@inlinable func set(homogeneous: Bool) -
set(interpolateSize:Extension method) Sets whether or not
stackwill interpolate its size when changing the visible child. If theGtkStack:interpolate-sizeproperty is set totrue,stackwill interpolate its size between the current one and the one it’ll take after changing the visible child, according to the set transition duration.Declaration
Swift
@inlinable func set(interpolateSize: Bool) -
setTransition(duration:Extension method) Sets the duration that transitions between pages in
stackwill take.Declaration
Swift
@inlinable func setTransition(duration: Int) -
setTransitionType(transition:Extension method) Sets the type of animation that will be used for transitions between pages in
stack. Available types include various kinds of fades and slides.The transition type can be changed without problems at runtime, so it is possible to change the animation based on the page that is about to become current.
Declaration
Swift
@inlinable func setTransitionType(transition: GtkStackTransitionType) -
set(vhomogeneous:Extension method) Sets the
GtkStackto be vertically homogeneous or not. If it is homogeneous, theGtkStackwill request the same height for all its children. If it isn’t, the stack may change height when a different child becomes visible.Declaration
Swift
@inlinable func set(vhomogeneous: Bool) -
setVisible(child:Extension method) Makes
childthe visible child ofstack.If
childis different from the currently visible child, the transition between the two will be animated with the current transition type ofstack.Note that the
childwidget has to be visible itself (seegtk_widget_show()) in order to become the visible child ofstack.Declaration
Swift
@inlinable func setVisible<WidgetT>(child: WidgetT) where WidgetT : WidgetProtocol -
setVisibleChildFull(name:Extension methodtransition: ) Makes the child with the given name visible.
Note that the child widget has to be visible itself (see
gtk_widget_show()) in order to become the visible child ofstack.Declaration
Swift
@inlinable func setVisibleChildFull(name: UnsafePointer<gchar>!, transition: GtkStackTransitionType) -
setVisibleChild(name:Extension method) Makes the child with the given name visible.
If
childis different from the currently visible child, the transition between the two will be animated with the current transition type ofstack.Note that the child widget has to be visible itself (see
gtk_widget_show()) in order to become the visible child ofstack.Declaration
Swift
@inlinable func setVisibleChild(name: UnsafePointer<gchar>!) -
hhomogeneousExtension methodtrueif the stack allocates the same width for all children.Declaration
Swift
@inlinable var hhomogeneous: Bool { get nonmutating set } -
homogeneousExtension methodUndocumented
Declaration
Swift
@inlinable var homogeneous: Bool { get nonmutating set } -
interpolateSizeExtension methodReturns wether the
GtkStackis set up to interpolate between the sizes of children on page switch.Declaration
Swift
@inlinable var interpolateSize: Bool { get nonmutating set } -
transitionDurationExtension methodReturns the amount of time (in milliseconds) that transitions between pages in
stackwill take.Declaration
Swift
@inlinable var transitionDuration: Int { get nonmutating set } -
transitionRunningExtension methodReturns whether the
stackis currently in a transition from one page to another.Declaration
Swift
@inlinable var transitionRunning: Bool { get } -
transitionTypeExtension methodGets the type of animation that will be used for transitions between pages in
stack.Declaration
Swift
@inlinable var transitionType: GtkStackTransitionType { get nonmutating set } -
vhomogeneousExtension methodtrueif the stack allocates the same height for all children.Declaration
Swift
@inlinable var vhomogeneous: Bool { get nonmutating set } -
visibleChildExtension methodGets the currently visible child of
stack, ornilif there are no visible children.Declaration
Swift
@inlinable var visibleChild: WidgetRef! { get nonmutating set } -
visibleChildNameExtension methodReturns the name of the currently visible child of
stack, ornilif there is no visible child.Declaration
Swift
@inlinable var visibleChildName: String! { get nonmutating set } -
parentInstanceExtension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GtkContainer { get }
View on GitHub
Install in Dash
StackProtocol Protocol Reference