Gtk.Inscription¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.Inscription(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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 asGtkColumnView
.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.
New in version 4.8.
- classmethod new(text)[source]¶
- Parameters:
- Returns:
a new
GtkInscription
- Return type:
Creates a new
GtkInscription
with the given text.New in version 4.8.
- get_attributes()[source]¶
- Returns:
the attribute list
- Return type:
Gets the inscription’s attribute list.
New in version 4.8.
- get_min_chars()[source]¶
- Returns:
the min-chars property
- Return type:
Gets the
min-chars
of the inscription.See the [property`Gtk`.Inscription:min-chars] property.
New in version 4.8.
- get_min_lines()[source]¶
- Returns:
the min-lines property
- Return type:
Gets the
min-lines
of the inscription.See the [property`Gtk`.Inscription:min-lines] property.
New in version 4.8.
- get_nat_chars()[source]¶
- Returns:
the nat-chars property
- Return type:
Gets the
nat-chars
of the inscription.See the [property`Gtk`.Inscription:nat-chars] property.
New in version 4.8.
- get_nat_lines()[source]¶
- Returns:
the nat-lines property
- Return type:
Gets the
nat-lines
of the inscription.See the [property`Gtk`.Inscription:nat-lines] property.
New in version 4.8.
- get_text_overflow()[source]¶
- Returns:
the overflow method
- Return type:
Gets the inscription’s overflow method.
New in version 4.8.
- get_wrap_mode()[source]¶
- Returns:
the line wrap mode
- Return type:
Returns line wrap mode used by the inscription.
See [method`Gtk`.Inscription.set_wrap_mode].
New in version 4.8.
- get_xalign()[source]¶
- Returns:
the xalign property
- Return type:
Gets the
xalign
of the inscription.See the [property`Gtk`.Inscription:xalign] property.
New in version 4.8.
- get_yalign()[source]¶
- Returns:
the yalign property
- Return type:
Gets the
yalign
of the inscription.See the [property`Gtk`.Inscription:yalign] property.
New in version 4.8.
- set_attributes(attrs)[source]¶
- Parameters:
attrs (
Pango.AttrList
orNone
) – a [struct`Pango`.AttrList]
Apply attributes to the inscription text.
These attributes will not be evaluated for sizing the inscription.
New in version 4.8.
- set_markup(markup)[source]¶
-
Utility function to set the text and attributes to be displayed.
See the [property`Gtk`.Inscription:markup] property.
New in version 4.8.
- set_min_chars(min_chars)[source]¶
- Parameters:
min_chars (
int
) – the minimum number of characters that should fit, approximately
Sets the
min-chars
of the inscription.See the [property`Gtk`.Inscription:min-chars] property.
New in version 4.8.
- set_min_lines(min_lines)[source]¶
- Parameters:
min_lines (
int
) – the minimum number of lines that should fit, approximately
Sets the
min-lines
of the inscription.See the [property`Gtk`.Inscription:min-lines] property.
New in version 4.8.
- set_nat_chars(nat_chars)[source]¶
- Parameters:
nat_chars (
int
) – the number of characters that should ideally fit, approximately
Sets the
nat-chars
of the inscription.See the [property`Gtk`.Inscription:nat-chars] property.
New in version 4.8.
- set_nat_lines(nat_lines)[source]¶
- Parameters:
nat_lines (
int
) – the number of lines that should ideally fit
Sets the
nat-lines
of the inscription.See the [property`Gtk`.Inscription:nat-lines] property.
New in version 4.8.
- set_text_overflow(overflow)[source]¶
- Parameters:
overflow (
Gtk.InscriptionOverflow
) – the overflow method to use
Sets what to do when the text doesn’t fit.
New in version 4.8.
- set_wrap_mode(wrap_mode)[source]¶
- Parameters:
wrap_mode (
Pango.WrapMode
) – the line wrapping mode
Controls how line wrapping is done.
New in version 4.8.
Property Details¶
- Gtk.Inscription.props.attributes¶
- Name:
attributes
- Type:
- Default Value:
- Flags:
A list of style attributes to apply to the text of the inscription.
New in version 4.8.
- Gtk.Inscription.props.markup¶
- Name:
markup
- Type:
- Default Value:
- Flags:
Utility property that sets both the [property`Gtk`.Inscription:text] and [property`Gtk`.Inscription:attributes] properties, mainly intended for use in
Gtk.Builder
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.
New in version 4.8.
- Gtk.Inscription.props.min_chars¶
- Name:
min-chars
- Type:
- Default Value:
3
- Flags:
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.
New in version 4.8.
- Gtk.Inscription.props.min_lines¶
- Name:
min-lines
- Type:
- Default Value:
1
- Flags:
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.
New in version 4.8.
- Gtk.Inscription.props.nat_chars¶
- Name:
nat-chars
- Type:
- Default Value:
0
- Flags:
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.
New in version 4.8.
- Gtk.Inscription.props.nat_lines¶
- Name:
nat-lines
- Type:
- Default Value:
0
- Flags:
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.
New in version 4.8.
- Gtk.Inscription.props.text¶
- Name:
text
- Type:
- Default Value:
- Flags:
The displayed text.
New in version 4.8.
- Gtk.Inscription.props.text_overflow¶
- Name:
text-overflow
- Type:
- Default Value:
- Flags:
The overflow method to use for the text.
New in version 4.8.
- Gtk.Inscription.props.wrap_mode¶
- Name:
wrap-mode
- Type:
- Default Value:
- Flags:
Controls how the line wrapping is done.
Note that unlike
GtkLabel
, the default here isPango.WrapMode.WORD_CHAR
.New in version 4.8.
- Gtk.Inscription.props.xalign¶
- Name:
xalign
- Type:
- Default Value:
0.0
- Flags:
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.
New in version 4.8.
- Gtk.Inscription.props.yalign¶
- Name:
yalign
- Type:
- Default Value:
0.5
- Flags:
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.
New in version 4.8.