CenterBoxProtocol
public protocol CenterBoxProtocol : OrientableProtocol, WidgetProtocol
GtkCenterBox arranges three children in a row, keeping the middle child
centered as well as possible.

To add children to GtkCenterBox, use [methodGtk.CenterBox.set_start_widget],
[methodGtk.CenterBox.set_center_widget] and
[methodGtk.CenterBox.set_end_widget].
The sizing and positioning of children can be influenced with the align and expand properties of the children.
GtkCenterBox as GtkBuildable
The GtkCenterBox implementation of the GtkBuildable interface
supports placing children in the 3 positions by specifying “start”, “center”
or “end” as the “type” attribute of a <child> element.
CSS nodes
GtkCenterBox uses a single CSS node with the name “box”,
The first child of the GtkCenterBox will be allocated depending on the
text direction, i.e. in left-to-right layouts it will be allocated on the
left and in right-to-left layouts on the right.
In vertical orientation, the nodes of the children are arranged from top to bottom.
Accessibility
GtkCenterBox uses the GTK_ACCESSIBLE_ROLE_GROUP role.
The CenterBoxProtocol protocol exposes the methods and properties of an underlying GtkCenterBox 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 CenterBox.
Alternatively, use CenterBoxRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkCenterBoxinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
center_box_ptrDefault implementationTyped pointer to the underlying
GtkCenterBoxinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkCenterBoxinstance.Declaration
Swift
var center_box_ptr: UnsafeMutablePointer<GtkCenterBox>! { get } -
Required Initialiser for types conforming to
CenterBoxProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
CenterBoxPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: CenterBoxPropertyName, 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 CenterBox property
Declaration
Swift
@inlinable func get(property: CenterBoxPropertyName) -> 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 CenterBox property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: CenterBoxPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
getBaselinePosition()Extension methodGets the value set by
gtk_center_box_set_baseline_position().Declaration
Swift
@inlinable func getBaselinePosition() -> GtkBaselinePosition -
getCenterWidget()Extension methodGets the center widget, or
nilif there is none.Declaration
Swift
@inlinable func getCenterWidget() -> WidgetRef! -
getEndWidget()Extension methodGets the end widget, or
nilif there is none.Declaration
Swift
@inlinable func getEndWidget() -> WidgetRef! -
getStartWidget()Extension methodGets the start widget, or
nilif there is none.Declaration
Swift
@inlinable func getStartWidget() -> WidgetRef! -
setBaseline(position:Extension method) Sets the baseline position of a center box.
This affects only horizontal boxes with at least one baseline aligned child. If there is more vertical space available than requested, and the baseline is not allocated by the parent then
positionis used to allocate the baseline wrt. the extra space available.Declaration
Swift
@inlinable func setBaseline(position: GtkBaselinePosition) -
setCenterWidget(child:Extension method) Sets the center widget.
To remove the existing center widget, pas
nil.Declaration
Swift
@inlinable func setCenterWidget(child: WidgetRef? = nil) -
setCenterWidget(child:Extension method) Sets the center widget.
To remove the existing center widget, pas
nil.Declaration
Swift
@inlinable func setCenterWidget<WidgetT>(child: WidgetT?) where WidgetT : WidgetProtocol -
setEndWidget(child:Extension method) Sets the end widget.
To remove the existing end widget, pass
nil.Declaration
Swift
@inlinable func setEndWidget(child: WidgetRef? = nil) -
setEndWidget(child:Extension method) Sets the end widget.
To remove the existing end widget, pass
nil.Declaration
Swift
@inlinable func setEndWidget<WidgetT>(child: WidgetT?) where WidgetT : WidgetProtocol -
setStartWidget(child:Extension method) Sets the start widget.
To remove the existing start widget, pass
nil.Declaration
Swift
@inlinable func setStartWidget(child: WidgetRef? = nil) -
setStartWidget(child:Extension method) Sets the start widget.
To remove the existing start widget, pass
nil.Declaration
Swift
@inlinable func setStartWidget<WidgetT>(child: WidgetT?) where WidgetT : WidgetProtocol -
baselinePositionExtension methodGets the value set by
gtk_center_box_set_baseline_position().Declaration
Swift
@inlinable var baselinePosition: GtkBaselinePosition { get nonmutating set } -
centerWidgetExtension methodGets the center widget, or
nilif there is none.Declaration
Swift
@inlinable var centerWidget: WidgetRef! { get nonmutating set } -
endWidgetExtension methodGets the end widget, or
nilif there is none.Declaration
Swift
@inlinable var endWidget: WidgetRef! { get nonmutating set } -
startWidgetExtension methodGets the start widget, or
nilif there is none.Declaration
Swift
@inlinable var startWidget: WidgetRef! { get nonmutating set }
View on GitHub
Install in Dash
CenterBoxProtocol Protocol Reference