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
GtkCenterBox
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
center_box_ptr
Default implementationTyped pointer to the underlying
GtkCenterBox
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkCenterBox
instance.Declaration
Swift
var center_box_ptr: UnsafeMutablePointer<GtkCenterBox>! { get }
-
Required Initialiser for types conforming to
CenterBoxProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
CenterBoxPropertyName
source 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 : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a CenterBox property
Declaration
Swift
@inlinable func get(property: CenterBoxPropertyName) -> GLibObject.Value
Parameters
property
the 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
property
the 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
nil
if there is none.Declaration
Swift
@inlinable func getCenterWidget() -> WidgetRef!
-
getEndWidget()
Extension methodGets the end widget, or
nil
if there is none.Declaration
Swift
@inlinable func getEndWidget() -> WidgetRef!
-
getStartWidget()
Extension methodGets the start widget, or
nil
if 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
position
is 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
-
baselinePosition
Extension methodGets the value set by
gtk_center_box_set_baseline_position()
.Declaration
Swift
@inlinable var baselinePosition: GtkBaselinePosition { get nonmutating set }
-
centerWidget
Extension methodGets the center widget, or
nil
if there is none.Declaration
Swift
@inlinable var centerWidget: WidgetRef! { get nonmutating set }
-
endWidget
Extension methodGets the end widget, or
nil
if there is none.Declaration
Swift
@inlinable var endWidget: WidgetRef! { get nonmutating set }
-
startWidget
Extension methodGets the start widget, or
nil
if there is none.Declaration
Swift
@inlinable var startWidget: WidgetRef! { get nonmutating set }