GridLayoutProtocol

public protocol GridLayoutProtocol : LayoutManagerProtocol

GtkGridLayout is a layout manager which arranges child widgets in rows and columns.

Children have an “attach point” defined by the horizontal and vertical index of the cell they occupy; children can span multiple rows or columns. The layout properties for setting the attach points and spans are set using the [classGtk.GridLayoutChild] associated to each child widget.

The behaviour of GtkGridLayout when several children occupy the same grid cell is undefined.

GtkGridLayout can be used like a GtkBoxLayout if all children are attached to the same row or column; however, if you only ever need a single row or column, you should consider using GtkBoxLayout.

The GridLayoutProtocol protocol exposes the methods and properties of an underlying GtkGridLayout 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 GridLayout. Alternatively, use GridLayoutRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkGridLayout instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkGridLayout instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkGridLayout instance.

    Declaration

    Swift

    var grid_layout_ptr: UnsafeMutablePointer<GtkGridLayout>! { get }
  • Required Initialiser for types conforming to GridLayoutProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

GridLayout Class

  • Bind a GridLayoutPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: GridLayoutPropertyName, 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 GridLayout property

    Declaration

    Swift

    @inlinable
    func get(property: GridLayoutPropertyName) -> 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 GridLayout property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: GridLayoutPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

GridLayout Class: GridLayoutProtocol extension (methods and fields)

  • getBaselineRow() Extension method

    Retrieves the row set with gtk_grid_layout_set_baseline_row().

    Declaration

    Swift

    @inlinable
    func getBaselineRow() -> Int
  • getColumnHomogeneous() Extension method

    Checks whether all columns of grid should have the same width.

    Declaration

    Swift

    @inlinable
    func getColumnHomogeneous() -> Bool
  • getColumnSpacing() Extension method

    Retrieves the spacing set with gtk_grid_layout_set_column_spacing().

    Declaration

    Swift

    @inlinable
    func getColumnSpacing() -> Int
  • getRowBaselinePosition(row:) Extension method

    Returns the baseline position of row.

    If no value has been set with [methodGtk.GridLayout.set_row_baseline_position], the default value of GTK_BASELINE_POSITION_CENTER is returned.

    Declaration

    Swift

    @inlinable
    func getRowBaselinePosition(row: Int) -> GtkBaselinePosition
  • getRowHomogeneous() Extension method

    Checks whether all rows of grid should have the same height.

    Declaration

    Swift

    @inlinable
    func getRowHomogeneous() -> Bool
  • getRowSpacing() Extension method

    Retrieves the spacing set with gtk_grid_layout_set_row_spacing().

    Declaration

    Swift

    @inlinable
    func getRowSpacing() -> Int
  • setBaseline(row:) Extension method

    Sets which row defines the global baseline for the entire grid.

    Each row in the grid can have its own local baseline, but only one of those is global, meaning it will be the baseline in the parent of the grid.

    Declaration

    Swift

    @inlinable
    func setBaseline(row: Int)
  • setColumn(homogeneous:) Extension method

    Sets whether all columns of grid should have the same width.

    Declaration

    Swift

    @inlinable
    func setColumn(homogeneous: Bool)
  • setColumn(spacing:) Extension method

    Sets the amount of space to insert between consecutive columns.

    Declaration

    Swift

    @inlinable
    func setColumn(spacing: Int)
  • Sets how the baseline should be positioned on row of the grid, in case that row is assigned more space than is requested.

    Declaration

    Swift

    @inlinable
    func setRowBaselinePosition(row: Int, pos: GtkBaselinePosition)
  • setRow(homogeneous:) Extension method

    Sets whether all rows of grid should have the same height.

    Declaration

    Swift

    @inlinable
    func setRow(homogeneous: Bool)
  • setRow(spacing:) Extension method

    Sets the amount of space to insert between consecutive rows.

    Declaration

    Swift

    @inlinable
    func setRow(spacing: Int)
  • baselineRow Extension method

    Retrieves the row set with gtk_grid_layout_set_baseline_row().

    Declaration

    Swift

    @inlinable
    var baselineRow: Int { get nonmutating set }
  • columnHomogeneous Extension method

    Checks whether all columns of grid should have the same width.

    Declaration

    Swift

    @inlinable
    var columnHomogeneous: Bool { get nonmutating set }
  • columnSpacing Extension method

    Retrieves the spacing set with gtk_grid_layout_set_column_spacing().

    Declaration

    Swift

    @inlinable
    var columnSpacing: Int { get nonmutating set }
  • rowHomogeneous Extension method

    Checks whether all rows of grid should have the same height.

    Declaration

    Swift

    @inlinable
    var rowHomogeneous: Bool { get nonmutating set }
  • rowSpacing Extension method

    Retrieves the spacing set with gtk_grid_layout_set_row_spacing().

    Declaration

    Swift

    @inlinable
    var rowSpacing: Int { get nonmutating set }