Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Inscription

[21:7] extends: object

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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Inscription (text = null)

    Creates a new GtkInscription with the given text.

    • @p text is The text to display..
  • 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.
  • asWidget ()

    Wraps this handle as Widget.

    • @r A Widget object.
  • asAccessible ()

    Wraps this handle as Accessible.

    • @r A Accessible object.
  • asAccessibleText ()

    Wraps this handle as AccessibleText.

    • @r A AccessibleText object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asConstraintTarget ()

    Wraps this handle as ConstraintTarget.

    • @r A ConstraintTarget object.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setAttributes (object Value)

    A list of style attributes to apply to the text of the inscription.

    • @p Value is the new property value.
    • @r None.
  • setMarkup (string Value)

    Utility property that sets both the [property@Gtk.Inscription:text] and [property@Gtk.Inscription:attributes] properties, mainly intended for use in GtkBuilder ui files to ease translation support and bindings. This function uses [func@Pango.parse_markup] to parse the markup into text and attributes. The markup must be valid. If you cannot ensure that, consider using [func@Pango.parse_markup] and setting the two properties yourself.

    • @p Value is the new property value.
    • @r None.
  • setMinchars (int Value)

    The number of characters that should fit into the inscription at minimum. This influences the requested width, not the width actually given to the widget, which might turn out to be larger. Note that this is an approximate character width, so some characters might be wider and some might be thinner, so do not expect the number of characters to exactly match. If you set this property to 0, the inscription will not request any width at all and its width will be determined entirely by its surroundings.

    • @p Value is the new property value.
    • @r None.
  • setMinlines (int Value)

    The number of lines that should fit into the inscription at minimum. This influences the requested height, not the height actually given to the widget, which might turn out to be larger. Note that this is an approximate line height, so if the text uses things like fancy Unicode or attribute that influence the height, the text might not fit. If you set this property to 0, the inscription will not request any height at all and its height will be determined entirely by its surroundings.

    • @p Value is the new property value.
    • @r None.
  • setNatchars (int Value)

    The number of characters that should ideally fit into the inscription. This influences the requested width, not the width actually given to the widget. The widget might turn out larger as well as smaller. If this property is set to a value smaller than [property@Gtk.Inscription:min-chars], that value will be used. In particular, for the default value of 0, this will always be the case.

    • @p Value is the new property value.
    • @r None.
  • setNatlines (int Value)

    The number of lines that should ideally fit into the inscription. This influences the requested height, not the height actually given to the widget. The widget might turn out larger as well as smaller. If this property is set to a value smaller than [property@Gtk.Inscription:min-lines], that value will be used. In particular, for the default value of 0, this will always be the case.

    • @p Value is the new property value.
    • @r None.
  • setText (string Value)

    The displayed text.

    • @p Value is the new property value.
    • @r None.
  • setTextoverflow (string Value)

    The overflow method to use for the text.

    • @p Value is the new property value.
    • @r None.
  • setWrapmode (string Value)

    Controls how the line wrapping is done. Note that unlike GtkLabel, the default here is %PANGO_WRAP_WORD_CHAR.

    • @p Value is the new property value.
    • @r None.
  • setXalign (double Value)

    The horizontal alignment of the text inside the allocated size. Compare this to [property@Gtk.Widget:halign], which determines how the inscription's size allocation is positioned in the available space.

    • @p Value is the new property value.
    • @r None.
  • setYalign (double Value)

    The vertical alignment of the text inside the allocated size. Compare this to [property@Gtk.Widget:valign], which determines how the inscription's size allocation is positioned in the available space.

    • @p Value is the new property value.
    • @r None.
  • get_attributes ()

    Gets the inscription's attribute list.

  • get_min_chars ()

    Gets the min-chars of the inscription. See the [property@Gtk.Inscription:min-chars] property.

  • get_min_lines ()

    Gets the min-lines of the inscription. See the [property@Gtk.Inscription:min-lines] property.

  • get_nat_chars ()

    Gets the nat-chars of the inscription. See the [property@Gtk.Inscription:nat-chars] property.

  • get_nat_lines ()

    Gets the nat-lines of the inscription. See the [property@Gtk.Inscription:nat-lines] property.

  • get_text ()

    Gets the text that is displayed.

  • get_text_overflow ()

    Gets the inscription's overflow method.

  • get_wrap_mode ()

    Returns line wrap mode used by the inscription. See [method@Gtk.Inscription.set_wrap_mode].

  • get_xalign ()

    Gets the xalign of the inscription. See the [property@Gtk.Inscription:xalign] property.

  • get_yalign ()

    Gets the yalign of the inscription. See the [property@Gtk.Inscription:yalign] property.

  • set_attributes (object attrs)

    Apply attributes to the inscription text. These attributes will not be evaluated for sizing the inscription.

    • @p attrs is a [struct@Pango.AttrList].
    • @r None.
  • set_markup (string markup)

    Utility function to set the text and attributes to be displayed. See the [property@Gtk.Inscription:markup] property.

    • @p markup is The markup to display.
    • @r None.
  • set_min_chars (int min_chars)

    Sets the min-chars of the inscription. See the [property@Gtk.Inscription:min-chars] property.

    • @p min_chars is the minimum number of characters that should fit, approximately.
    • @r None.
  • set_min_lines (int min_lines)

    Sets the min-lines of the inscription. See the [property@Gtk.Inscription:min-lines] property.

    • @p min_lines is the minimum number of lines that should fit, approximately.
    • @r None.
  • set_nat_chars (int nat_chars)

    Sets the nat-chars of the inscription. See the [property@Gtk.Inscription:nat-chars] property.

    • @p nat_chars is the number of characters that should ideally fit, approximately.
    • @r None.
  • set_nat_lines (int nat_lines)

    Sets the nat-lines of the inscription. See the [property@Gtk.Inscription:nat-lines] property.

    • @p nat_lines is the number of lines that should ideally fit.
    • @r None.
  • set_text (string text)

    Sets the text to be displayed.

    • @p text is The text to display.
    • @r None.
  • set_text_overflow (string overflow)

    Sets what to do when the text doesn't fit.

    • @p overflow is the overflow method to use.
    • @r None.
  • set_wrap_mode (string wrap_mode)

    Controls how line wrapping is done.

    • @p wrap_mode is the line wrapping mode.
    • @r None.
  • set_xalign (double xalign)

    Sets the xalign of the inscription. See the [property@Gtk.Inscription:xalign] property.

    • @p xalign is the new xalign value, between 0 and 1.
    • @r None.
  • set_yalign (double yalign)

    Sets the yalign of the inscription. See the [property@Gtk.Inscription:yalign] property.

    • @p yalign is the new yalign value, between 0 and 1.
    • @r None.

class: InscriptionMeta

[563:14] static extends: object

Generated metadata helpers for Inscription class surfaces.

Methods

  • properties ()

    Returns property metadata for Inscription.

    • @r A list.