BoxRef

public struct BoxRef : BoxProtocol, GWeakCapturing

The GtkBox widget arranges child widgets into a single row or column.

An example GtkBox

Whether it is a row or column depends on the value of its [propertyGtk.Orientable:orientation] property. Within the other dimension, all children are allocated the same size. Of course, the [propertyGtk.Widget:halign] and [propertyGtk.Widget:valign] properties can be used on the children to influence their allocation.

Use repeated calls to [methodGtk.Box.append] to pack widgets into a GtkBox from start to end. Use [methodGtk.Box.remove] to remove widgets from the GtkBox. [methodGtk.Box.insert_child_after] can be used to add a child at a particular position.

Use [methodGtk.Box.set_homogeneous] to specify whether or not all children of the GtkBox are forced to get the same amount of space.

Use [methodGtk.Box.set_spacing] to determine how much space will be minimally placed between all children in the GtkBox. Note that spacing is added between the children.

Use [methodGtk.Box.reorder_child_after] to move a child to a different place in the box.

CSS nodes

GtkBox uses a single CSS node with name box.

Accessibility

GtkBox uses the GTK_ACCESSIBLE_ROLE_GROUP role.

The BoxRef type acts as a lightweight Swift reference to an underlying GtkBox instance. It exposes methods that can operate on this data type through BoxProtocol conformance. Use BoxRef only as an unowned reference to an existing GtkBox instance.

  • ptr
    Untyped pointer to the underlying `GtkBox` instance.
    

    For type-safe access, use the generated, typed pointer box_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

Box Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkBox>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkBox>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkBox>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkBox>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements BoxProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : BoxProtocol
  • This factory is syntactic sugar for setting weak pointers wrapped in GWeak<T>

    Declaration

    Swift

    @inlinable
    static func unowned<T>(_ other: T) -> BoxRef where T : BoxProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to BoxProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to BoxProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to BoxProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to BoxProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to BoxProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a new GtkBox.

    Declaration

    Swift

    @inlinable
    init(orientation: GtkOrientation, spacing: Int)