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: <Error class: unknown class>, constant: <Error class: unknown class>, strength: <Error class: unknown class>)

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: <Error class: unknown class>, strength: <Error class: unknown class>)

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: <Error class: unknown class>

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: <Error class: unknown class>

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: <Error class: unknown class>

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 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.