Constraint

open class Constraint(pointer: <Error class: unknown class><<Error class: unknown class>>)

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

Link copied to clipboard
constructor(target: ConstraintTarget? = null, targetAttribute: ConstraintAttribute, relation: ConstraintRelation, source: ConstraintTarget? = null, sourceAttribute: ConstraintAttribute, multiplier: Double, constant: Double, strength: Int)

Creates a new constraint representing a relation between a layout attribute on a source and a layout attribute on a target.

constructor(target: ConstraintTarget? = null, targetAttribute: ConstraintAttribute, relation: ConstraintRelation, constant: Double, strength: Int)

Creates a new constraint representing a relation between a layout attribute on a target and a constant value.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val constant: Double

The constant value to be added to the property@Gtk.Constraint:source-attribute.

Link copied to clipboard
val gtkConstraintPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val multiplier: Double

The multiplication factor to be applied to the property@Gtk.Constraint:source-attribute.

Link copied to clipboard

The order relation between the terms of the constraint.

Link copied to clipboard

The source of the constraint.

Link copied to clipboard

The attribute of the property@Gtk.Constraint:source read by the constraint.

Link copied to clipboard
open val strength: Int

The strength of the constraint.

Link copied to clipboard

The target of the constraint.

Link copied to clipboard

The attribute of the property@Gtk.Constraint:target set by the constraint.

Functions

Link copied to clipboard
open fun getConstant(): Double

Retrieves the constant factor added to the source attributes' value.

Link copied to clipboard
open fun getMultiplier(): Double

Retrieves the multiplication factor applied to the source attribute's value.

Link copied to clipboard

The order relation between the terms of the constraint.

Link copied to clipboard

Retrieves the iface@Gtk.ConstraintTarget used as the source for the constraint.

Link copied to clipboard

Retrieves the attribute of the source to be read by the constraint.

Link copied to clipboard
open fun getStrength(): Int

Retrieves the strength of the constraint.

Link copied to clipboard

Retrieves the iface@Gtk.ConstraintTarget used as the target for the constraint.

Link copied to clipboard

Retrieves the attribute of the target to be set by the constraint.

Link copied to clipboard
open fun isAttached(): Boolean

Checks whether the constraint is attached to a class@Gtk.ConstraintLayout, and it is contributing to the layout.

Link copied to clipboard
open fun isConstant(): Boolean

Checks whether the constraint describes a relation between an attribute on the property@Gtk.Constraint:target and a constant value.

Link copied to clipboard
open fun isRequired(): Boolean

Checks whether the constraint is a required relation for solving the constraint layout.