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.
-
Untyped pointer to the underlying
GtkGridLayout
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
grid_layout_ptr
Default implementationTyped 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)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) 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 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 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:
Extension methodvalue: ) 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
-
getBaselineRow()
Extension methodRetrieves the row set with
gtk_grid_layout_set_baseline_row()
.Declaration
Swift
@inlinable func getBaselineRow() -> Int
-
getColumnHomogeneous()
Extension methodChecks whether all columns of
grid
should have the same width.Declaration
Swift
@inlinable func getColumnHomogeneous() -> Bool
-
getColumnSpacing()
Extension methodRetrieves 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 [method
Gtk.GridLayout.set_row_baseline_position
], the default value ofGTK_BASELINE_POSITION_CENTER
is returned.Declaration
Swift
@inlinable func getRowBaselinePosition(row: Int) -> GtkBaselinePosition
-
getRowHomogeneous()
Extension methodChecks whether all rows of
grid
should have the same height.Declaration
Swift
@inlinable func getRowHomogeneous() -> Bool
-
getRowSpacing()
Extension methodRetrieves 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)
-
setRowBaselinePosition(row:
Extension methodpos: ) 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 methodRetrieves the row set with
gtk_grid_layout_set_baseline_row()
.Declaration
Swift
@inlinable var baselineRow: Int { get nonmutating set }
-
columnHomogeneous
Extension methodChecks whether all columns of
grid
should have the same width.Declaration
Swift
@inlinable var columnHomogeneous: Bool { get nonmutating set }
-
columnSpacing
Extension methodRetrieves the spacing set with
gtk_grid_layout_set_column_spacing()
.Declaration
Swift
@inlinable var columnSpacing: Int { get nonmutating set }
-
rowHomogeneous
Extension methodChecks whether all rows of
grid
should have the same height.Declaration
Swift
@inlinable var rowHomogeneous: Bool { get nonmutating set }
-
rowSpacing
Extension methodRetrieves the spacing set with
gtk_grid_layout_set_row_spacing()
.Declaration
Swift
@inlinable var rowSpacing: Int { get nonmutating set }