Class ConstraintGuide

All Implemented Interfaces:
PointerInterface

public class ConstraintGuide extends Object
A `GtkConstraintGuide` is an invisible layout element in a
`GtkConstraintLayout`.

The `GtkConstraintLayout` treats guides like widgets. They
can be used as the source or target of a `GtkConstraint`.

Guides have a minimum, maximum and natural size. Depending
on the constraints that are applied, they can act like a
guideline that widgets can be aligned to, or like *flexible
space*.

Unlike a `GtkWidget`, a `GtkConstraintGuide` will not be drawn.

https://docs.gtk.org/gtk4/class.ConstraintGuide.html

  • Constructor Details

    • ConstraintGuide

      public ConstraintGuide(PointerContainer pointer)
    • ConstraintGuide

      public ConstraintGuide()
      Creates a new `GtkConstraintGuide` object.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getMaxSize

      public void getMaxSize(@Nullable Int width, @Nullable Int height)
      Gets the maximum size of @guide.
      Parameters:
      width - return location for the maximum width
      height - return location for the maximum height
    • getMinSize

      public void getMinSize(@Nullable Int width, @Nullable Int height)
      Gets the minimum size of @guide.
      Parameters:
      width - return location for the minimum width
      height - return location for the minimum height
    • getName

      public Str getName()
      Retrieves the name set using gtk_constraint_guide_set_name().
      Returns:
      the name of the guide
    • getNatSize

      public void getNatSize(@Nullable Int width, @Nullable Int height)
      Gets the natural size of @guide.
      Parameters:
      width - return location for the natural width
      height - return location for the natural height
    • getStrength

      public int getStrength()
      Retrieves the strength set using gtk_constraint_guide_set_strength().
      Returns:
      the strength of the constraint on the natural size
    • setMaxSize

      public void setMaxSize(int width, int height)
      Sets the maximum size of @guide.

      If @guide is attached to a `GtkConstraintLayout`,
      the constraints will be updated to reflect the new size.
      Parameters:
      width - the new maximum width, or -1 to not change it
      height - the new maximum height, or -1 to not change it
    • setMinSize

      public void setMinSize(int width, int height)
      Sets the minimum size of @guide.

      If @guide is attached to a `GtkConstraintLayout`,
      the constraints will be updated to reflect the new size.
      Parameters:
      width - the new minimum width, or -1 to not change it
      height - the new minimum height, or -1 to not change it
    • setName

      public void setName(@Nullable Str name)
      Sets a name for the given `GtkConstraintGuide`.

      The name is useful for debugging purposes.
      Parameters:
      name - a name for the @guide
    • setName

      public void setName(String name)
      Sets a name for the given `GtkConstraintGuide`.

      The name is useful for debugging purposes.
      Parameters:
      name - a name for the @guide
    • setNatSize

      public void setNatSize(int width, int height)
      Sets the natural size of @guide.

      If @guide is attached to a `GtkConstraintLayout`,
      the constraints will be updated to reflect the new size.
      Parameters:
      width - the new natural width, or -1 to not change it
      height - the new natural height, or -1 to not change it
    • setStrength

      public void setStrength(int strength)
      Sets the strength of the constraint on the natural size of the
      given `GtkConstraintGuide`.
      Parameters:
      strength - the strength of the constraint
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Returns:
      ConstraintTarget
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()