ConstraintRef

public struct ConstraintRef : ConstraintProtocol, GWeakCapturing

GtkConstraint describes a constraint between attributes of two widgets, expressed as a linear equation.

The typical equation for a constraint is:

  target.target_attr = source.source_attr × multiplier + constant

Each GtkConstraint is part of a system that will be solved by a [classGtk.ConstraintLayout] in order to allocate and position each child widget or guide.

The source and target, as well as their attributes, of a GtkConstraint instance are immutable after creation.

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

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

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

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

Constraint Class