gtk.constraint
Module for [Constraint] class
Types 3
gtk.constraint.Constraint 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 + constantEach gtk.constraint.Constraint is part of a system that will be solved by a gtk.constraint_layout.ConstraintLayout in order to allocate and position each child widget or guide.
The source and target, as well as their attributes, of a gtk.constraint.Constraint instance are immutable after creation.
Methods
ConstraintGidBuilder builder() static nothrowGet builder for [gtk.constraint.Constraint] Returns: New builder objectdouble constant() @property nothrowGet `constant` property. Returns: The constant value to be added to the [gtk.constraint.Constraint.sourceAttribute].double multiplier() @property nothrowGet `multiplier` property. Returns: The multiplication factor to be applied to the [gtk.constraint.Constraint.sourceAttribute].gtk.types.ConstraintRelation relation() @property nothrowGet `relation` property. Returns: The order relation between the terms of the constraint.gtk.constraint_target.ConstraintTarget source() @property nothrowGet `source` property. Returns: The source of the constraint.gtk.types.ConstraintAttribute sourceAttribute() @property nothrowGet `sourceAttribute` property. Returns: The attribute of the [gtk.constraint.Constraint.source] read by the constraint.gtk.constraint_target.ConstraintTarget target() @property nothrowGet `target` property. Returns: The target of the constraint.gtk.types.ConstraintAttribute targetAttribute() @property nothrowGet `targetAttribute` property. Returns: The attribute of the [gtk.constraint.Constraint.target] set by the constraint.gtk.constraint.Constraint newConstant(gtk.constraint_target.ConstraintTarget target, gtk.types.ConstraintAttribute targetAttribute, gtk.types.ConstraintRelation relation, double constant, int strength) static nothrowCreates a new constraint representing a relation between a layout attribute on a target and a constant value.double getConstant() nothrowRetrieves the constant factor added to the source attributes' value. Returns: a constant factordouble getMultiplier() nothrowRetrieves the multiplication factor applied to the source attribute's value. Returns: a multiplication factorgtk.types.ConstraintRelation getRelation() nothrowThe order relation between the terms of the constraint. Returns: a relation typegtk.constraint_target.ConstraintTarget getSource() nothrowRetrieves the [gtk.constraint_target.ConstraintTarget] used as the source for the constraint.gtk.types.ConstraintAttribute getSourceAttribute() nothrowRetrieves the attribute of the source to be read by the constraint. Returns: the source's attributegtk.constraint_target.ConstraintTarget getTarget() nothrowRetrieves the [gtk.constraint_target.ConstraintTarget] used as the target for the constraint.gtk.types.ConstraintAttribute getTargetAttribute() nothrowRetrieves the attribute of the target to be set by the constraint. Returns: the target's attributebool isAttached() nothrowChecks whether the constraint is attached to a [gtk.constraint_layout.ConstraintLayout], and it is contributing to the layout. Returns: `TRUE` if the constraint is attachedbool isConstant() nothrowChecks whether the constraint describes a relation between an attribute on the [gtk.constraint.Constraint.target] and a constant value. Returns: `TRUE` if the constraint is a constant relationbool isRequired() nothrowChecks whether the constraint is a required relation for solving the constraint layout. Returns: true if the constraint is requiredConstructors
this(gtk.constraint_target.ConstraintTarget target, gtk.types.ConstraintAttribute targetAttribute, gtk.types.ConstraintRelation relation, gtk.constraint_target.ConstraintTarget source, gtk.types.ConstraintAttribute sourceAttribute, double multiplier, double constant, int strength)Creates a new constraint representing a relation between a layout attribute on a source and a layout attribute on a target.Fluent builder implementation template for gtk.constraint.Constraint
Methods
T constant(double propval) nothrowSet `constant` property. Params: propval = The constant value to be added to the [gtk.constraint.Constraint.sourceAttribute]. Returns: Builder instance for fluent chainingT multiplier(double propval) nothrowSet `multiplier` property. Params: propval = The multiplication factor to be applied to the [gtk.constraint.Constraint.sourceAttribute]. Returns: Builder instance for fluent chainingT relation(gtk.types.ConstraintRelation propval) nothrowSet `relation` property. Params: propval = The order relation between the terms of the constraint. Returns: Builder instance for fluent chainingT source(gtk.constraint_target.ConstraintTarget propval) nothrowSet `source` property. Params: propval = The source of the constraint.T sourceAttribute(gtk.types.ConstraintAttribute propval) nothrowSet `sourceAttribute` property. Params: propval = The attribute of the [gtk.constraint.Constraint.source] read by the constraint. Returns: Builder instance for fluent chainingT strength(int propval) nothrowSet `strength` property. Params: propval = The strength of the constraint.T target(gtk.constraint_target.ConstraintTarget propval) nothrowSet `target` property. Params: propval = The target of the constraint.T targetAttribute(gtk.types.ConstraintAttribute propval) nothrowSet `targetAttribute` property. Params: propval = The attribute of the [gtk.constraint.Constraint.target] set by the constraint. Returns: Builder instance for fluent chainingFluent builder for gtk.constraint.Constraint
Methods