Gnome::Gtk4::CellRendererText
Table of Contents
Description§
Renders text in a cell
A Gnome::Gtk4::CellRendererText renders a given text in its cell, using the font, color and style information provided by its properties. The text will be ellipsized if it is too long and the Gnome::Gtk4::CellRendererText:ellipsize` property allows it.
If the Gnome::Gtk4::CellRenderer:mode` is GTK_CELL_RENDERER_MODE_EDITABLE, the Gnome::Gtk4::CellRendererText allows to edit its text using an entry.
Uml Diagram§
UNKNOWN image§
=for image :class<inline> :src<asset_files/images/plantuml/CellRendererText.png> :width<70\%>Class initialization§
Note: The native version of this class is deprecated in gtk4-lib() since version 4.10
new§
:native-object§
Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object() :$native-object! )
new-cellrenderertext§
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Creates a new Gnome::Gtk4::CellRendererText. Adjust how text is drawn using object properties. Object properties can be set globally (with g_object_set()). Also, with Gnome::Gtk4::TreeViewColumn, you can bind a property to a value in a Gnome::Gtk4::R-TreeModel. For example, you can bind the ātextā property on the cell renderer to a string value in the model, thus rendering a different string in each row of the Gnome::Gtk4::TreeView.
method new-cellrenderertext ( --> Gnome::Gtk4::CellRendererText )
Methods§
set-fixed-height-from-font§
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Sets the height of a renderer to explicitly be determined by the āfontā and āy_padā property set on it. Further changes in these properties do not affect the height, so they must be accompanied by a subsequent call to this function. Using this function is inflexible, and should really only be used if calculating the size of a cell is too slow (ie, a massive number of cells displayed). If $number-of-rows is -1, then the fixed height is unset, and the height is determined by the properties again.
method set-fixed-height-from-font ( Int() $number-of-rows )
- $number-of-rows; Number of rows of text each cell renderer is allocated, or -1.
Signals§
edited§
This signal is emitted after $renderer has been edited.
It is the responsibility of the application to update the model and store $new-text at the position indicated by $path.
method handler ( Str $path, Str $new-text, Int :$_handle_id, N-GObject :$_native-object, Gnome::Gtk4::CellRendererText :$_widget, *%user-options )
- $path; the path identifying the edited cell.
- $new-text; the new text.
- $_handle_id; The registered event handler id.
- $_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::CellRendererText object.
- %user-options; A list of named arguments provided by .register-signal() in class Object.
About my projects, examples and tutorials