Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ConstraintMeta

[261:14] static extends: object

Generated metadata helpers for Constraint class surfaces.

Methods

  • properties ()

    Returns property metadata for Constraint.

    • @r A list.

class: Constraint

[19:7] extends: object

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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Constraint (target = null, target_attribute = null, relation = null, source = null, source_attribute = null, multiplier = null, constant = null, strength = null)

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

    • @p target is the target of the constraint.
    • @p target_attribute is the attribute of target to be set.
    • @p relation is the relation equivalence between target_attribute and source_attribute.
    • @p source is the source of the constraint.
    • @p source_attribute is the attribute of source to be read.
    • @p multiplier is a multiplication factor to be applied to source_attribute.
    • @p constant is a constant factor to be added to source_attribute.
    • @p strength is the strength of the constraint.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • get_constant ()

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

  • get_multiplier ()

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

  • get_relation ()

    The order relation between the terms of the constraint.

  • get_source ()

    Retrieves the [iface@Gtk.ConstraintTarget] used as the source for the constraint. If the source is set to NULL at creation, the constraint will use the widget using the [class@Gtk.ConstraintLayout] as the source.

  • get_source_attribute ()

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

  • get_strength ()

    Retrieves the strength of the constraint.

  • get_target ()

    Retrieves the [iface@Gtk.ConstraintTarget] used as the target for the constraint. If the targe is set to NULL at creation, the constraint will use the widget using the [class@Gtk.ConstraintLayout] as the target.

  • get_target_attribute ()

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

  • is_attached ()

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

  • is_constant ()

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

  • is_required ()

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

class: ConstraintCtors

[236:14] static extends: object

Alternate constructors for Constraint. Usage: ConstraintCtors.<name>(...). The primary constructor lives directly on Constraint.

Methods

  • newConstant (object target, string target_attribute, string relation, double constant, int strength)

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

    • @p target is a the target of the constraint.
    • @p target_attribute is the attribute of target to be set.
    • @p relation is the relation equivalence between target_attribute and constant.
    • @p constant is a constant factor to be set on target_attribute.
    • @p strength is the strength of the constraint.
    • @r A new Constraint.