Basics
Guides
API Reference
Basics
Guides
API Reference
[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.
Inscription (text = null)
Creates a new
GtkInscriptionwith the given text.
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 exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asWidget ()
Wraps this handle as
Widget.
A Widget object.asAccessible ()
Wraps this handle as
Accessible.
A Accessible object.asAccessibleText ()
Wraps this handle as
AccessibleText.
A AccessibleText object.asBuildable ()
Wraps this handle as
Buildable.
A Buildable object.asConstraintTarget ()
Wraps this handle as
ConstraintTarget.
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.
Value is the new property value.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.
Value is the new property value.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.
Value is the new property value.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.
Value is the new property value.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.
Value is the new property value.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.
Value is the new property value.None.setText (string Value)
The displayed text.
Value is the new property value.None.setTextoverflow (string Value)
The overflow method to use for the text.
Value is the new property value.None.setWrapmode (string Value)
Controls how the line wrapping is done. Note that unlike
GtkLabel, the default here is %PANGO_WRAP_WORD_CHAR.
Value is the new property value.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.
Value is the new property value.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.
Value is the new property value.None.get_attributes ()
Gets the inscription's attribute list.
get_min_chars ()
Gets the
min-charsof the inscription. See the [property@Gtk.Inscription:min-chars] property.
get_min_lines ()
Gets the
min-linesof the inscription. See the [property@Gtk.Inscription:min-lines] property.
get_nat_chars ()
Gets the
nat-charsof the inscription. See the [property@Gtk.Inscription:nat-chars] property.
get_nat_lines ()
Gets the
nat-linesof 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
xalignof the inscription. See the [property@Gtk.Inscription:xalign] property.
get_yalign ()
Gets the
yalignof 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.
attrs is a [struct@Pango.AttrList].None.set_markup (string markup)
Utility function to set the text and attributes to be displayed. See the [property@Gtk.Inscription:markup] property.
markup is The markup to display.None.set_min_chars (int min_chars)
Sets the
min-charsof the inscription. See the [property@Gtk.Inscription:min-chars] property.
min_chars is the minimum number of characters that should fit, approximately.None.set_min_lines (int min_lines)
Sets the
min-linesof the inscription. See the [property@Gtk.Inscription:min-lines] property.
min_lines is the minimum number of lines that should fit, approximately.None.set_nat_chars (int nat_chars)
Sets the
nat-charsof the inscription. See the [property@Gtk.Inscription:nat-chars] property.
nat_chars is the number of characters that should ideally fit, approximately.None.set_nat_lines (int nat_lines)
Sets the
nat-linesof the inscription. See the [property@Gtk.Inscription:nat-lines] property.
nat_lines is the number of lines that should ideally fit.None.set_text (string text)
Sets the text to be displayed.
text is The text to display.None.set_text_overflow (string overflow)
Sets what to do when the text doesn't fit.
overflow is the overflow method to use.None.set_wrap_mode (string wrap_mode)
Controls how line wrapping is done.
wrap_mode is the line wrapping mode.None.set_xalign (double xalign)
Sets the
xalignof the inscription. See the [property@Gtk.Inscription:xalign] property.
xalign is the new xalign value, between 0 and 1.None.set_yalign (double yalign)
Sets the
yalignof the inscription. See the [property@Gtk.Inscription:yalign] property.
yalign is the new yalign value, between 0 and 1.None.[563:14] static extends: object
Generated metadata helpers for Inscription class surfaces.
properties ()
Returns property metadata for
Inscription.
A list.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.