### Class

# GtkConstraint

#### Description [src]

    final class Gtk.Constraint : GObject.Object
    {
      /* No available fields */
    }

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

#### Hierarchy

#### Ancestors

- GObject

#### Constructors

###### gtk_constraint_new

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

###### gtk_constraint_new_constant

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

#### Instance methods

###### gtk_constraint_get_constant

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

###### gtk_constraint_get_multiplier

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

###### gtk_constraint_get_relation

The order relation between the terms of the constraint.

###### gtk_constraint_get_source

Retrieves the `GtkConstraintTarget` used as the source for the constraint.

###### gtk_constraint_get_source_attribute

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

###### gtk_constraint_get_strength

Retrieves the strength of the constraint.

###### gtk_constraint_get_target

Retrieves the `GtkConstraintTarget` used as the target for the constraint.

###### gtk_constraint_get_target_attribute

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

###### gtk_constraint_is_attached

Checks whether the constraint is attached to a `GtkConstraintLayout`, and it is contributing to the layout.

###### gtk_constraint_is_constant

Checks whether the constraint describes a relation between an attribute on the `GtkConstraint:target` and a constant value.

###### gtk_constraint_is_required

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

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gtk.Constraint:constant

The constant value to be added to the `GtkConstraint:source-attribute`.

###### Gtk.Constraint:multiplier

The multiplication factor to be applied to the `GtkConstraint:source-attribute`.

###### Gtk.Constraint:relation

The order relation between the terms of the constraint.

###### Gtk.Constraint:source

The source of the constraint.

###### Gtk.Constraint:source-attribute

The attribute of the `GtkConstraint:source` read by the constraint.

###### Gtk.Constraint:strength

The strength of the constraint.

###### Gtk.Constraint:target

The target of the constraint.

###### Gtk.Constraint:target-attribute

The attribute of the `GtkConstraint:target` set by the constraint.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GtkConstraintClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`
  No description available.