1.103 <GtkInscription>

Class: <GtkInscription>

It derives from <GtkWidget>.

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.

Properties

Property: inscription:attributes self

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

Its value is a <PangoAttrList>, or #f.

Set it with (set! (inscription:attributes self) value).

Property: inscription:markup self

Utility property that sets both the inscription:text and inscription:attributes properties, mainly intended for use in GtkBuilder ui files to ease translation support and bindings.

This function uses parse-markup to parse the markup into text and attributes. The markup must be valid. If you cannot ensure that, consider using parse-markup and setting the two properties yourself.

Its value is a string, or #f.

It can only be set, with (set! (inscription:markup self) value).

Property: inscription:min-chars self

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.

Its value is an unsigned 32-bit integer.

Set it with (set! (inscription:min-chars self) value).

Property: inscription:min-lines self

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.

Its value is an unsigned 32-bit integer.

Set it with (set! (inscription:min-lines self) value).

Property: inscription:nat-chars self

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 inscription:min-chars, that value will be used. In particular, for the default value of 0, this will always be the case.

Its value is an unsigned 32-bit integer.

Set it with (set! (inscription:nat-chars self) value).

Property: inscription:nat-lines self

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 inscription:min-lines, that value will be used. In particular, for the default value of 0, this will always be the case.

Its value is an unsigned 32-bit integer.

Set it with (set! (inscription:nat-lines self) value).

Property: inscription:text self

The displayed text.

Its value is a string, or #f.

Set it with (set! (inscription:text self) value).

Property: inscription:text-overflow self

The overflow method to use for the text.

Its value is a <GtkInscriptionOverflow> (or, to set it, one of its symbols).

Set it with (set! (inscription:text-overflow self) value).

Property: inscription:wrap-mode self

Controls how the line wrapping is done.

Note that unlike <GtkLabel>, the default here is word-char.

Its value is a <PangoWrapMode> (or, to set it, one of its symbols).

Set it with (set! (inscription:wrap-mode self) value).

Property: inscription:xalign self

The horizontal alignment of the text inside the allocated size.

Compare this to widget:halign, which determines how the inscription’s size allocation is positioned in the available space.

Its value is a real number.

Set it with (set! (inscription:xalign self) value).

Property: inscription:yalign self

The vertical alignment of the text inside the allocated size.

Compare this to widget:valign, which determines how the inscription’s size allocation is positioned in the available space.

Its value is a real number.

Set it with (set! (inscription:yalign self) value).

Procedures

Method: inscription:get-attributes self ⇒ %return
Method: get-attributes self ⇒ %return

Gets the inscription’s attribute list.

self

Passed: a <GtkInscription>.

a <GtkInscription>

%return

Returned: a <PangoAttrList>, or #f.

the attribute list

Method: inscription:get-min-chars self ⇒ %return
Method: get-min-chars self ⇒ %return

Gets the min-chars of the inscription.

See the inscription:min-chars property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

%return

Returned: an unsigned 32-bit integer.

the min-chars property

Method: inscription:get-min-lines self ⇒ %return
Method: get-min-lines self ⇒ %return

Gets the min-lines of the inscription.

See the inscription:min-lines property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

%return

Returned: an unsigned 32-bit integer.

the min-lines property

Method: inscription:get-nat-chars self ⇒ %return
Method: get-nat-chars self ⇒ %return

Gets the nat-chars of the inscription.

See the inscription:nat-chars property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

%return

Returned: an unsigned 32-bit integer.

the nat-chars property

Method: inscription:get-nat-lines self ⇒ %return
Method: get-nat-lines self ⇒ %return

Gets the nat-lines of the inscription.

See the inscription:nat-lines property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

%return

Returned: an unsigned 32-bit integer.

the nat-lines property

Method: inscription:get-text self ⇒ %return
Method: get-text self ⇒ %return

Gets the text that is displayed.

self

Passed: a <GtkInscription>.

a <GtkInscription>

%return

Returned: a string, or #f.

The displayed text

Method: inscription:get-text-overflow self ⇒ %return
Method: get-text-overflow self ⇒ %return

Gets the inscription’s overflow method.

self

Passed: a <GtkInscription>.

a <GtkInscription>

%return

Returned: a <GtkInscriptionOverflow>.

the overflow method

Method: inscription:get-wrap-mode self ⇒ %return
Method: get-wrap-mode self ⇒ %return

Returns line wrap mode used by the inscription.

See inscription:set-wrap-mode.

self

Passed: a <GtkInscription>.

a <GtkInscription>

%return

Returned: a <PangoWrapMode>.

the line wrap mode

Method: inscription:get-xalign self ⇒ %return
Method: get-xalign self ⇒ %return

Gets the xalign of the inscription.

See the inscription:xalign property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

%return

Returned: a real number.

the xalign property

Method: inscription:get-yalign self ⇒ %return
Method: get-yalign self ⇒ %return

Gets the yalign of the inscription.

See the inscription:yalign property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

%return

Returned: a real number.

the yalign property

Procedure: inscription:new [text] ⇒ %return

Creates a new <GtkInscription> with the given text.

text

Passed, or left out: a string, or #f.

The text to display.

%return

Returned: a <GtkWidget>.

a new <GtkInscription>

Method: inscription:set-attributes self [attrs]
Method: set-attributes self [attrs]

Apply attributes to the inscription text.

These attributes will not be evaluated for sizing the inscription.

self

Passed: a <GtkInscription>.

a <GtkInscription>

attrs

Passed, or left out: a <PangoAttrList>, or #f.

a <PangoAttrList>

Method: inscription:set-markup self [markup]
Method: set-markup self [markup]

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

See the inscription:markup property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

markup

Passed, or left out: a string, or #f.

The markup to display

Method: inscription:set-min-chars self min-chars
Method: set-min-chars self min-chars

Sets the min-chars of the inscription.

See the inscription:min-chars property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

min-chars

Passed: an unsigned 32-bit integer.

the minimum number of characters that should fit, approximately

Method: inscription:set-min-lines self min-lines
Method: set-min-lines self min-lines

Sets the min-lines of the inscription.

See the inscription:min-lines property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

min-lines

Passed: an unsigned 32-bit integer.

the minimum number of lines that should fit, approximately

Method: inscription:set-nat-chars self nat-chars
Method: set-nat-chars self nat-chars

Sets the nat-chars of the inscription.

See the inscription:nat-chars property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

nat-chars

Passed: an unsigned 32-bit integer.

the number of characters that should ideally fit, approximately

Method: inscription:set-nat-lines self nat-lines
Method: set-nat-lines self nat-lines

Sets the nat-lines of the inscription.

See the inscription:nat-lines property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

nat-lines

Passed: an unsigned 32-bit integer.

the number of lines that should ideally fit

Method: inscription:set-text self [text]
Method: set-text self [text]

Sets the text to be displayed.

self

Passed: a <GtkInscription>.

a <GtkInscription>

text

Passed, or left out: a string, or #f.

The text to display

Method: inscription:set-text-overflow self overflow
Method: set-text-overflow self overflow

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

self

Passed: a <GtkInscription>.

a <GtkInscription>

overflow

Passed: a <GtkInscriptionOverflow>, or one of its symbols.

the overflow method to use

Method: inscription:set-wrap-mode self wrap-mode
Method: set-wrap-mode self wrap-mode

Controls how line wrapping is done.

self

Passed: a <GtkInscription>.

a <GtkInscription>

wrap-mode

Passed: a <PangoWrapMode>, or one of its symbols.

the line wrapping mode

Method: inscription:set-xalign self xalign
Method: set-xalign self xalign

Sets the xalign of the inscription.

See the inscription:xalign property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

xalign

Passed: a real number.

the new xalign value, between 0 and 1

Method: inscription:set-yalign self yalign
Method: set-yalign self yalign

Sets the yalign of the inscription.

See the inscription:yalign property.

self

Passed: a <GtkInscription>.

a <GtkInscription>

yalign

Passed: a real number.

the new yalign value, between 0 and 1