Basics
Guides
API Reference
Basics
Guides
API Reference
[261:14] static extends: object
Generated metadata helpers for Constraint class surfaces.
properties ()
Returns property metadata for
Constraint.
A list.[19:7] extends: object
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
[class@Gtk.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.
Constraint (target = null, target_attribute = null, relation = null, source = null, source_attribute = null, multiplier = null, constant = null, strength = null)
Creates a new constraint representing a relation between a layout attribute on a source and a layout attribute on a target.
target is the target of the constraint.target_attribute is the attribute of target to be set.relation is the relation equivalence between target_attribute and source_attribute.source is the source of the constraint.source_attribute is the attribute of source to be read.multiplier is a multiplication factor to be applied to source_attribute.constant is a constant factor to be added to source_attribute.strength is the strength of the constraint.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.get_constant ()
Retrieves the constant factor added to the source attributes' value.
get_multiplier ()
Retrieves the multiplication factor applied to the source attribute's value.
get_relation ()
The order relation between the terms of the constraint.
get_source ()
Retrieves the [iface@Gtk.ConstraintTarget] used as the source for the constraint. If the source is set to
NULLat creation, the constraint will use the widget using the [class@Gtk.ConstraintLayout] as the source.
get_source_attribute ()
Retrieves the attribute of the source to be read by the constraint.
get_strength ()
Retrieves the strength of the constraint.
get_target ()
Retrieves the [iface@Gtk.ConstraintTarget] used as the target for the constraint. If the targe is set to
NULLat creation, the constraint will use the widget using the [class@Gtk.ConstraintLayout] as the target.
get_target_attribute ()
Retrieves the attribute of the target to be set by the constraint.
is_attached ()
Checks whether the constraint is attached to a [class@Gtk.ConstraintLayout], and it is contributing to the layout.
is_constant ()
Checks whether the constraint describes a relation between an attribute on the [property@Gtk.Constraint:target] and a constant value.
is_required ()
Checks whether the constraint is a required relation for solving the constraint layout.
[236:14] static extends: object
Alternate constructors for Constraint. Usage:
ConstraintCtors.<name>(...). The primary constructor lives
directly on Constraint.
newConstant (object target, string target_attribute, string relation, double constant, int strength)
Creates a new constraint representing a relation between a layout attribute on a target and a constant value.
target is a the target of the constraint.target_attribute is the attribute of target to be set.relation is the relation equivalence between target_attribute and constant.constant is a constant factor to be set on target_attribute.strength is the strength of the constraint.A new Constraint.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.