About all my projects
Gnome::Gtk4::Constraint

Gnome::Gtk4::Constraint

Description

Gnome::Gtk4::Constraint describes a constraint between attributes of two widgets, expressed as a linear equation.

The typical equation for a constraint is:

Each Gnome::Gtk4::Constraint is part of a system that will be solved by a Gnome::Gtk4::ConstraintLayout in order to allocate and position each child widget or guide.

The source and target, as well as their attributes, of a Gnome::Gtk4::Constraint instance are immutable after creation.

Class initialization

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

new-constraint

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

method new-constraint ( gpointer $target, GtkConstraintAttribute $target-attribute, GtkConstraintRelation $relation, gpointer $source, GtkConstraintAttribute $source-attribute, Num() $multiplier, Num() $constant, Int() $strength --> Gnome::Gtk4::Constraint \)
  • $target; the target of the constraint.

  • $target-attribute; the attribute of target to be set.

  • $relation; the relation equivalence between target_attribute and source_attribute.

  • $source; the source of the constraint.

  • $source-attribute; the attribute of source to be read.

  • $multiplier; a multiplication factor to be applied to source_attribute.

  • $constant; a constant factor to be added to source_attribute.

  • $strength; the strength of the constraint.

new-constant

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

method new-constant ( gpointer $target, GtkConstraintAttribute $target-attribute, GtkConstraintRelation $relation, Num() $constant, Int() $strength --> Gnome::Gtk4::Constraint \)
  • $target; a the target of the constraint.

  • $target-attribute; the attribute of target to be set.

  • $relation; the relation equivalence between target_attribute and constant.

  • $constant; a constant factor to be set on target_attribute.

  • $strength; the strength of the constraint.

Methods

get-constant

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

method get-constant (--> Num )

Return value; a constant factor.

get-multiplier

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

method get-multiplier (--> Num )

Return value; a multiplication factor.

get-relation

The order relation between the terms of the constraint.

method get-relation (--> GtkConstraintRelation )

Return value; a relation type.

get-source

Retrieves the Gnome::Gtk4::R-ConstraintTarget used as the source for the constraint.

If the source is set to undefined at creation, the constraint will use the widget using the Gnome::Gtk4::ConstraintLayout as the source.

method get-source (--> N-Object )

Return value; the source of the constraint.

get-source-attribute

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

method get-source-attribute (--> GtkConstraintAttribute )

Return value; the source's attribute.

get-strength

Retrieves the strength of the constraint.

method get-strength (--> Int )

Return value; the strength value.

get-target

Retrieves the Gnome::Gtk4::R-ConstraintTarget used as the target for the constraint.

If the targe is set to undefined at creation, the constraint will use the widget using the Gnome::Gtk4::ConstraintLayout as the target.

method get-target (--> N-Object )

Return value; a Gnome::Gtk4::R-ConstraintTarget.

get-target-attribute

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

method get-target-attribute (--> GtkConstraintAttribute )

Return value; the target's attribute.

is-attached

Checks whether the constraint is attached to a Gnome::Gtk4::ConstraintLayout, and it is contributing to the layout.

method is-attached (--> Bool )

Return value; True if the constraint is attached.

is-constant

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

method is-constant (--> Bool )

Return value; True if the constraint is a constant relation.

is-required

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

method is-required (--> Bool )

Return value; True if the constraint is required.