Class Inscription

All Implemented Interfaces:
PointerInterface

public class Inscription extends Widget
`GtkInscription` is a widget to show text in a predefined area.

You likely want to use `GtkLabel` instead as this widget is intended only
for a small subset of use cases. The main scenario envisaged is inside lists
such as `GtkColumnView`.

While a `GtkLabel` sizes itself depending on the text that is displayed,
`GtkInscription` is given a size and inscribes the given text into that
space as well as it can.

Users of this widget should take care to plan behaviour for the common case
where the text doesn't fit exactly in the allocated space, .

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

  • Constructor Details

    • Inscription

      public Inscription(PointerContainer pointer)
    • Inscription

      public Inscription(@Nullable Str text)
      Creates a new `GtkInscription` with the given text.
      Parameters:
      text - The text to display.
    • Inscription

      public Inscription(String text)
      Creates a new `GtkInscription` with the given text.
      Parameters:
      text - The text to display.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getAttributes

      public AttrList getAttributes()
      Gets the inscription's attribute list.
      Returns:
      the attribute list
    • getMinChars

      public int getMinChars()
      Gets the `min-chars` of the inscription.

      See the [property@Gtk.Inscription:min-chars] property.
      Returns:
      the min-chars property
    • getMinLines

      public int getMinLines()
      Gets the `min-lines` of the inscription.

      See the [property@Gtk.Inscription:min-lines] property.
      Returns:
      the min-lines property
    • getNatChars

      public int getNatChars()
      Gets the `nat-chars` of the inscription.

      See the [property@Gtk.Inscription:nat-chars] property.
      Returns:
      the nat-chars property
    • getNatLines

      public int getNatLines()
      Gets the `nat-lines` of the inscription.

      See the [property@Gtk.Inscription:nat-lines] property.
      Returns:
      the nat-lines property
    • getText

      public Str getText()
      Gets the text that is displayed.
      Returns:
      The displayed text
    • getTextOverflow

      public int getTextOverflow()
      Gets the inscription's overflow method.
      Returns:
      the overflow method
    • getWrapMode

      public int getWrapMode()
      Returns line wrap mode used by the inscription.

      See [method@Gtk.Inscription.set_wrap_mode].
      Returns:
      the line wrap mode
    • getXalign

      public float getXalign()
      Gets the `xalign` of the inscription.

      See the [property@Gtk.Inscription:xalign] property.
      Returns:
      the xalign property
    • getYalign

      public float getYalign()
      Gets the `yalign` of the inscription.

      See the [property@Gtk.Inscription:yalign] property.
      Returns:
      the yalign property
    • setAttributes

      public void setAttributes(@Nullable AttrList attrs)
      Apply attributes to the inscription text.

      These attributes will not be evaluated for sizing the inscription.
      Parameters:
      attrs - a [struct@Pango.AttrList]
    • setMarkup

      public void setMarkup(@Nullable Str markup)
      Utility function to set the text and attributes to be displayed.

      See the [property@Gtk.Inscription:markup] property.
      Parameters:
      markup - The markup to display
    • setMarkup

      public void setMarkup(String markup)
      Utility function to set the text and attributes to be displayed.

      See the [property@Gtk.Inscription:markup] property.
      Parameters:
      markup - The markup to display
    • setMinChars

      public void setMinChars(int min_chars)
      Sets the `min-chars` of the inscription.

      See the [property@Gtk.Inscription:min-chars] property.
      Parameters:
      min_chars - the minimum number of characters that should fit, approximately
    • setMinLines

      public void setMinLines(int min_lines)
      Sets the `min-lines` of the inscription.

      See the [property@Gtk.Inscription:min-lines] property.
      Parameters:
      min_lines - the minimum number of lines that should fit, approximately
    • setNatChars

      public void setNatChars(int nat_chars)
      Sets the `nat-chars` of the inscription.

      See the [property@Gtk.Inscription:nat-chars] property.
      Parameters:
      nat_chars - the number of characters that should ideally fit, approximately
    • setNatLines

      public void setNatLines(int nat_lines)
      Sets the `nat-lines` of the inscription.

      See the [property@Gtk.Inscription:nat-lines] property.
      Parameters:
      nat_lines - the number of lines that should ideally fit
    • setText

      public void setText(@Nullable Str text)
      Sets the text to be displayed.
      Parameters:
      text - The text to display
    • setText

      public void setText(String text)
      Sets the text to be displayed.
      Parameters:
      text - The text to display
    • setTextOverflow

      public void setTextOverflow(int overflow)
      Sets what to do when the text doesn't fit.
      Parameters:
      overflow - the overflow method to use
    • setWrapMode

      public void setWrapMode(int wrap_mode)
      Controls how line wrapping is done.
      Parameters:
      wrap_mode - the line wrapping mode
    • setXalign

      public void setXalign(float xalign)
      Sets the `xalign` of the inscription.

      See the [property@Gtk.Inscription:xalign] property.
      Parameters:
      xalign - the new xalign value, between 0 and 1
    • setYalign

      public void setYalign(float yalign)
      Sets the `yalign` of the inscription.

      See the [property@Gtk.Inscription:yalign] property.
      Parameters:
      yalign - the new yalign value, between 0 and 1
    • 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()