CenterBoxProtocol

public protocol CenterBoxProtocol : OrientableProtocol, WidgetProtocol

GtkCenterBox arranges three children in a row, keeping the middle child centered as well as possible.

An example GtkCenterBox

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.

  • ptr

    Untyped pointer to the underlying GtkCenterBox instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • center_box_ptr Default implementation

    Typed 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)

CenterBox Class

  • 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 transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return 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:value:) Extension method

    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

CenterBox Class: CenterBoxProtocol extension (methods and fields)

  • getBaselinePosition() Extension method

    Gets the value set by gtk_center_box_set_baseline_position().

    Declaration

    Swift

    @inlinable
    func getBaselinePosition() -> GtkBaselinePosition
  • getCenterWidget() Extension method

    Gets the center widget, or nil if there is none.

    Declaration

    Swift

    @inlinable
    func getCenterWidget() -> WidgetRef!
  • getEndWidget() Extension method

    Gets the end widget, or nil if there is none.

    Declaration

    Swift

    @inlinable
    func getEndWidget() -> WidgetRef!
  • getStartWidget() Extension method

    Gets 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 method

    Gets the value set by gtk_center_box_set_baseline_position().

    Declaration

    Swift

    @inlinable
    var baselinePosition: GtkBaselinePosition { get nonmutating set }
  • centerWidget Extension method

    Gets the center widget, or nil if there is none.

    Declaration

    Swift

    @inlinable
    var centerWidget: WidgetRef! { get nonmutating set }
  • endWidget Extension method

    Gets the end widget, or nil if there is none.

    Declaration

    Swift

    @inlinable
    var endWidget: WidgetRef! { get nonmutating set }
  • startWidget Extension method

    Gets the start widget, or nil if there is none.

    Declaration

    Swift

    @inlinable
    var startWidget: WidgetRef! { get nonmutating set }