FlowBoxRef
public struct FlowBoxRef : FlowBoxProtocol, GWeakCapturing
A GtkFlowBox
puts child widgets in reflowing grid.
For instance, with the horizontal orientation, the widgets will be arranged from left to right, starting a new row under the previous row when necessary. Reducing the width in this case will require more rows, so a larger height will be requested.
Likewise, with the vertical orientation, the widgets will be arranged from top to bottom, starting a new column to the right when necessary. Reducing the height will require more columns, so a larger width will be requested.
The size request of a GtkFlowBox
alone may not be what you expect;
if you need to be able to shrink it along both axes and dynamically
reflow its children, you may have to wrap it in a GtkScrolledWindow
to enable that.
The children of a GtkFlowBox
can be dynamically sorted and filtered.
Although a GtkFlowBox
must have only GtkFlowBoxChild
children, you
can add any kind of widget to it via [methodGtk.FlowBox.insert
], and a
GtkFlowBoxChild
widget will automatically be inserted between the box
and the widget.
Also see [classGtk.ListBox
].
CSS nodes
flowbox
├── flowboxchild
│ ╰── <child>
├── flowboxchild
│ ╰── <child>
┊
╰── [rubberband]
GtkFlowBox
uses a single CSS node with name flowbox. GtkFlowBoxChild
uses a single CSS node with name flowboxchild. For rubberband selection,
a subnode with name rubberband is used.
Accessibility
GtkFlowBox
uses the GTK_ACCESSIBLE_ROLE_GRID
role, and GtkFlowBoxChild
uses the GTK_ACCESSIBLE_ROLE_GRID_CELL
role.
The FlowBoxRef
type acts as a lightweight Swift reference to an underlying GtkFlowBox
instance.
It exposes methods that can operate on this data type through FlowBoxProtocol
conformance.
Use FlowBoxRef
only as an unowned
reference to an existing GtkFlowBox
instance.
-
Untyped pointer to the underlying `GtkFlowBox` instance.
For type-safe access, use the generated, typed pointer
flow_box_ptr
property instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkFlowBox>)
-
Designated initialiser from a constant pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkFlowBox>)
-
Conditional initialiser from an optional pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkFlowBox>?)
-
Conditional initialiser from an optional, non-mutable pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkFlowBox>?)
-
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
FlowBoxProtocol
Declaration
Swift
@inlinable init<T>(_ other: T) where T : FlowBoxProtocol
-
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>
Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> FlowBoxRef where T : FlowBoxProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
FlowBoxProtocol
.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
FlowBoxProtocol
.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
FlowBoxProtocol
.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
FlowBoxProtocol
.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
FlowBoxProtocol
.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)
-
Creates a
GtkFlowBox
.Declaration
Swift
@inlinable init()