Class Inscription

All Implemented Interfaces:
Accessible, AccessibleText, Buildable, ConstraintTarget, Proxy

@Generated("org.javagi.JavaGI") public class Inscription extends Widget implements Accessible, AccessibleText, Buildable, ConstraintTarget

Shows 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.

CSS nodes

GtkInscription has a single CSS node with the name label.

Since:
4.8
  • Constructor Details

    • Inscription

      public Inscription(MemorySegment address)
      Create a Inscription instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • Inscription

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

      public Inscription()
      Create a new Inscription.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the Inscription class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected Inscription asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Widget
      Returns:
      the instance as if it were its parent type
    • getAttributes

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

      public int getMinChars()

      Gets the min-chars of the inscription.

      See the Gtk.Inscription:min-chars property.

      Returns:
      the min-chars property
      Since:
      4.8
    • getMinLines

      public int getMinLines()

      Gets the min-lines of the inscription.

      See the Gtk.Inscription:min-lines property.

      Returns:
      the min-lines property
      Since:
      4.8
    • getNatChars

      public int getNatChars()

      Gets the nat-chars of the inscription.

      See the Gtk.Inscription:nat-chars property.

      Returns:
      the nat-chars property
      Since:
      4.8
    • getNatLines

      public int getNatLines()

      Gets the nat-lines of the inscription.

      See the Gtk.Inscription:nat-lines property.

      Returns:
      the nat-lines property
      Since:
      4.8
    • getText

      public @Nullable String getText()
      Gets the text that is displayed.
      Returns:
      The displayed text
      Since:
      4.8
    • getTextOverflow

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

      public WrapMode getWrapMode()

      Returns line wrap mode used by the inscription.

      See setWrapMode(WrapMode).

      Returns:
      the line wrap mode
      Since:
      4.8
    • getXalign

      public float getXalign()

      Gets the xalign of the inscription.

      See the Gtk.Inscription:xalign property.

      Returns:
      the xalign property
      Since:
      4.8
    • getYalign

      public float getYalign()

      Gets the yalign of the inscription.

      See the Gtk.Inscription:yalign property.

      Returns:
      the yalign property
      Since:
      4.8
    • 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 Pango.AttrList
      Since:
      4.8
    • setMarkup

      public void setMarkup(@Nullable String markup)

      Utility function to set the text and attributes to be displayed.

      See the Gtk.Inscription:markup property.

      Parameters:
      markup - The markup to display
      Since:
      4.8
    • setMinChars

      public void setMinChars(int minChars)

      Sets the min-chars of the inscription.

      See the Gtk.Inscription:min-chars property.

      Parameters:
      minChars - the minimum number of characters that should fit, approximately
      Since:
      4.8
    • setMinLines

      public void setMinLines(int minLines)

      Sets the min-lines of the inscription.

      See the Gtk.Inscription:min-lines property.

      Parameters:
      minLines - the minimum number of lines that should fit, approximately
      Since:
      4.8
    • setNatChars

      public void setNatChars(int natChars)

      Sets the nat-chars of the inscription.

      See the Gtk.Inscription:nat-chars property.

      Parameters:
      natChars - the number of characters that should ideally fit, approximately
      Since:
      4.8
    • setNatLines

      public void setNatLines(int natLines)

      Sets the nat-lines of the inscription.

      See the Gtk.Inscription:nat-lines property.

      Parameters:
      natLines - the number of lines that should ideally fit
      Since:
      4.8
    • setText

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

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

      public void setWrapMode(WrapMode wrapMode)
      Controls how line wrapping is done.
      Parameters:
      wrapMode - the line wrapping mode
      Since:
      4.8
    • setXalign

      public void setXalign(float xalign)

      Sets the xalign of the inscription.

      See the Gtk.Inscription:xalign property.

      Parameters:
      xalign - the new xalign value, between 0 and 1
      Since:
      4.8
    • setYalign

      public void setYalign(float yalign)

      Sets the yalign of the inscription.

      See the Gtk.Inscription:yalign property.

      Parameters:
      yalign - the new yalign value, between 0 and 1
      Since:
      4.8
    • builder

      public static Inscription.Builder<? extends Inscription.Builder> builder()
      A Inscription.Builder object constructs a Inscription with the specified properties. Use the various set...() methods to set properties, and finish construction with Inscription.Builder.build().
      Returns:
      the builder object