Class AspectFrame

All Implemented Interfaces:
PointerInterface

public class AspectFrame extends Widget
`GtkAspectFrame` preserves the aspect ratio of its child.

The frame can respect the aspect ratio of the child widget,
or use its own aspect ratio.

# CSS nodes

`GtkAspectFrame` uses a CSS node with name `frame`.

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

  • Constructor Details

    • AspectFrame

      public AspectFrame(PointerContainer pointer)
    • AspectFrame

      public AspectFrame(float xalign, float yalign, float ratio, boolean obey_child)
      Create a new `GtkAspectFrame`.
      Parameters:
      xalign - Horizontal alignment of the child within the parent. Ranges from 0.0 (left aligned) to 1.0 (right aligned)
      yalign - Vertical alignment of the child within the parent. Ranges from 0.0 (top aligned) to 1.0 (bottom aligned)
      ratio - The desired aspect ratio.
      obey_child - If %TRUE, @ratio is ignored, and the aspect ratio is taken from the requistion of the child.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getChild

      public Widget getChild()
      Gets the child widget of @self.
      Returns:
      the child widget of self@
    • getObeyChild

      public boolean getObeyChild()
      Returns whether the child's size request should override
      the set aspect ratio of the `GtkAspectFrame`.
      Returns:
      whether to obey the child's size request
    • getRatio

      public float getRatio()
      Returns the desired aspect ratio of the child.
      Returns:
      the desired aspect ratio
    • getXalign

      public float getXalign()
      Returns the horizontal alignment of the child within the
      allocation of the `GtkAspectFrame`.
      Returns:
      the horizontal alignment
    • getYalign

      public float getYalign()
      Returns the vertical alignment of the child within the
      allocation of the `GtkAspectFrame`.
      Returns:
      the vertical alignment
    • setChild

      public void setChild(@Nullable Widget child)
      Sets the child widget of @self.
      Parameters:
      child - the child widget
    • setObeyChild

      public void setObeyChild(boolean obey_child)
      Sets whether the aspect ratio of the child's size
      request should override the set aspect ratio of
      the `GtkAspectFrame`.
      Parameters:
      obey_child - If %TRUE, @ratio is ignored, and the aspect ratio is taken from the requistion of the child.
    • setRatio

      public void setRatio(float ratio)
      Sets the desired aspect ratio of the child.
      Parameters:
      ratio - aspect ratio of the child
    • setXalign

      public void setXalign(float xalign)
      Sets the horizontal alignment of the child within the allocation
      of the `GtkAspectFrame`.
      Parameters:
      xalign - horizontal alignment, from 0.0 (left aligned) to 1.0 (right aligned)
    • setYalign

      public void setYalign(float yalign)
      Sets the vertical alignment of the child within the allocation
      of the `GtkAspectFrame`.
      Parameters:
      yalign - horizontal alignment, from 0.0 (top aligned) to 1.0 (bottom aligned)
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Widget
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Widget
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      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()