Constraint
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 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.
Constructors
Creates a new constraint representing a relation between a layout attribute on a source and a layout attribute on a target.
Creates a new constraint representing a relation between a layout attribute on a target and a constant value.
Properties
The multiplication factor to be applied to the property@Gtk.Constraint:source-attribute.
The order relation between the terms of the constraint.
The source of the constraint.
The attribute of the property@Gtk.Constraint:source read by the constraint.
The target of the constraint.
The attribute of the property@Gtk.Constraint:target set by the constraint.
Functions
Retrieves the constant factor added to the source attributes' value.
Retrieves the multiplication factor applied to the source attribute's value.
The order relation between the terms of the constraint.
Retrieves the iface@Gtk.ConstraintTarget used as the source for the constraint.
Retrieves the attribute of the source to be read by the constraint.
Retrieves the strength of the constraint.
Retrieves the iface@Gtk.ConstraintTarget used as the target for the constraint.
Retrieves the attribute of the target to be set by the constraint.
Checks whether the constraint is attached to a class@Gtk.ConstraintLayout, and it is contributing to the layout.
Checks whether the constraint describes a relation between an attribute on the property@Gtk.Constraint:target and a constant value.
Checks whether the constraint is a required relation for solving the constraint layout.