class Gtk::CellRendererText
Overview
Renders text in a cell
A Gtk::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 Gtk::CellRendererText:ellipsize
property allows it.
If the Gtk::CellRenderer:mode
is %GTK_CELL_RENDERER_MODE_EDITABLE,
the Gtk::CellRendererText
allows to edit its text using an entry.
Direct Known Subclasses
Defined in:
lib/gi-crystal/src/auto/gtk-4.0/cell_renderer_text.crConstructors
-
.new : self
Creates a new
Gtk::CellRendererText
. - .new(*, align_set : Bool | Nil = nil, alignment : Pango::Alignment | Nil = nil, attributes : Pango::AttrList | Nil = nil, background : String | Nil = nil, background_rgba : Gdk::RGBA | Nil = nil, background_set : Bool | Nil = nil, cell_background : String | Nil = nil, cell_background_rgba : Gdk::RGBA | Nil = nil, cell_background_set : Bool | Nil = nil, editable : Bool | Nil = nil, editable_set : Bool | Nil = nil, editing : Bool | Nil = nil, ellipsize : Pango::EllipsizeMode | Nil = nil, ellipsize_set : Bool | Nil = nil, family : String | Nil = nil, family_set : Bool | Nil = nil, font : String | Nil = nil, font_desc : Pango::FontDescription | Nil = nil, foreground : String | Nil = nil, foreground_rgba : Gdk::RGBA | Nil = nil, foreground_set : Bool | Nil = nil, height : Int32 | Nil = nil, is_expanded : Bool | Nil = nil, is_expander : Bool | Nil = nil, language : String | Nil = nil, language_set : Bool | Nil = nil, markup : String | Nil = nil, max_width_chars : Int32 | Nil = nil, mode : Gtk::CellRendererMode | Nil = nil, placeholder_text : String | Nil = nil, rise : Int32 | Nil = nil, rise_set : Bool | Nil = nil, scale : Float64 | Nil = nil, scale_set : Bool | Nil = nil, sensitive : Bool | Nil = nil, single_paragraph_mode : Bool | Nil = nil, size : Int32 | Nil = nil, size_points : Float64 | Nil = nil, size_set : Bool | Nil = nil, stretch : Pango::Stretch | Nil = nil, stretch_set : Bool | Nil = nil, strikethrough : Bool | Nil = nil, strikethrough_set : Bool | Nil = nil, style : Pango::Style | Nil = nil, style_set : Bool | Nil = nil, text : String | Nil = nil, underline : Pango::Underline | Nil = nil, underline_set : Bool | Nil = nil, variant : Pango::Variant | Nil = nil, variant_set : Bool | Nil = nil, visible : Bool | Nil = nil, weight : Int32 | Nil = nil, weight_set : Bool | Nil = nil, width : Int32 | Nil = nil, width_chars : Int32 | Nil = nil, wrap_mode : Pango::WrapMode | Nil = nil, wrap_width : Int32 | Nil = nil, xalign : Float32 | Nil = nil, xpad : UInt32 | Nil = nil, yalign : Float32 | Nil = nil, ypad : UInt32 | Nil = nil)
Class Method Summary
-
.g_type : UInt64
Returns the type id (GType) registered in GLib type system.
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. - #align_set=(value : Bool) : Bool
- #align_set? : Bool
-
#alignment : Pango::Alignment
Fills in xalign and yalign with the appropriate values of cell.
- #alignment=(value : Pango::Alignment) : Pango::Alignment
- #attributes : Pango::AttrList | Nil
- #attributes=(value : Pango::AttrList | Nil) : Pango::AttrList | Nil
- #background=(value : String) : String
-
#background=(value : Nil) : Nil
Set
#background
property to nil. - #background_rgba : Gdk::RGBA | Nil
- #background_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil
- #background_set=(value : Bool) : Bool
- #background_set? : Bool
- #editable=(value : Bool) : Bool
- #editable? : Bool
- #editable_set=(value : Bool) : Bool
- #editable_set? : Bool
- #edited_signal
- #ellipsize : Pango::EllipsizeMode
- #ellipsize=(value : Pango::EllipsizeMode) : Pango::EllipsizeMode
- #ellipsize_set=(value : Bool) : Bool
- #ellipsize_set? : Bool
- #family : String
- #family=(value : String) : String
-
#family=(value : Nil) : Nil
Set
#family
property to nil. -
#family? : String | Nil
Same as
#family
, but can return nil. - #family_set=(value : Bool) : Bool
- #family_set? : Bool
-
#fixed_height_from_font=(number_of_rows : Int32) : Nil
Sets the height of a renderer to explicitly be determined by the “font” and “y_pad” property set on it.
- #font : String
- #font=(value : String) : String
-
#font=(value : Nil) : Nil
Set
#font
property to nil. -
#font? : String | Nil
Same as
#font
, but can return nil. - #font_desc : Pango::FontDescription | Nil
- #font_desc=(value : Pango::FontDescription | Nil) : Pango::FontDescription | Nil
- #foreground=(value : String) : String
-
#foreground=(value : Nil) : Nil
Set
#foreground
property to nil. - #foreground_rgba : Gdk::RGBA | Nil
- #foreground_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil
- #foreground_set=(value : Bool) : Bool
- #foreground_set? : Bool
-
#hash(hasher)
See
Object#hash(hasher)
- #language : String
- #language=(value : String) : String
-
#language=(value : Nil) : Nil
Set
#language
property to nil. -
#language? : String | Nil
Same as
#language
, but can return nil. - #language_set=(value : Bool) : Bool
- #language_set? : Bool
- #markup=(value : String) : String
-
#markup=(value : Nil) : Nil
Set
#markup
property to nil. - #max_width_chars : Int32
- #max_width_chars=(value : Int32) : Int32
- #placeholder_text : String
- #placeholder_text=(value : String) : String
-
#placeholder_text=(value : Nil) : Nil
Set
#placeholder_text
property to nil. -
#placeholder_text? : String | Nil
Same as
#placeholder_text
, but can return nil. - #rise : Int32
- #rise=(value : Int32) : Int32
- #rise_set=(value : Bool) : Bool
- #rise_set? : Bool
- #scale : Float64
- #scale=(value : Float64) : Float64
- #scale_set=(value : Bool) : Bool
- #scale_set? : Bool
- #single_paragraph_mode=(value : Bool) : Bool
- #single_paragraph_mode? : Bool
- #size : Int32
- #size=(value : Int32) : Int32
- #size_points : Float64
- #size_points=(value : Float64) : Float64
- #size_set=(value : Bool) : Bool
- #size_set? : Bool
- #stretch : Pango::Stretch
- #stretch=(value : Pango::Stretch) : Pango::Stretch
- #stretch_set=(value : Bool) : Bool
- #stretch_set? : Bool
- #strikethrough=(value : Bool) : Bool
- #strikethrough? : Bool
- #strikethrough_set=(value : Bool) : Bool
- #strikethrough_set? : Bool
- #style : Pango::Style
- #style=(value : Pango::Style) : Pango::Style
- #style_set=(value : Bool) : Bool
- #style_set? : Bool
- #text : String
- #text=(value : String) : String
-
#text=(value : Nil) : Nil
Set
#text
property to nil. -
#text? : String | Nil
Same as
#text
, but can return nil. - #underline : Pango::Underline
- #underline=(value : Pango::Underline) : Pango::Underline
- #underline_set=(value : Bool) : Bool
- #underline_set? : Bool
- #variant : Pango::Variant
- #variant=(value : Pango::Variant) : Pango::Variant
- #variant_set=(value : Bool) : Bool
- #variant_set? : Bool
- #weight : Int32
- #weight=(value : Int32) : Int32
- #weight_set=(value : Bool) : Bool
- #weight_set? : Bool
- #width_chars : Int32
- #width_chars=(value : Int32) : Int32
- #wrap_mode : Pango::WrapMode
- #wrap_mode=(value : Pango::WrapMode) : Pango::WrapMode
- #wrap_width : Int32
- #wrap_width=(value : Int32) : Int32
Instance methods inherited from class Gtk::CellRenderer
==(other : self)
==,
activate(event : Gdk::Event, widget : Gtk::Widget, path : String, background_area : Gdk::Rectangle, cell_area : Gdk::Rectangle, flags : Gtk::CellRendererState) : Bool
activate,
aligned_area(widget : Gtk::Widget, flags : Gtk::CellRendererState, cell_area : Gdk::Rectangle) : Gdk::Rectangle
aligned_area,
alignment : Nil
alignment,
cell_background=(value : String) : Stringcell_background=(value : Nil) : Nil cell_background=, cell_background_rgba : Gdk::RGBA | Nil cell_background_rgba, cell_background_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil cell_background_rgba=, cell_background_set=(value : Bool) : Bool cell_background_set=, cell_background_set? : Bool cell_background_set?, editing? : Bool editing?, editing_canceled_signal editing_canceled_signal, editing_started_signal editing_started_signal, fixed_size : Nil fixed_size, hash(hasher) hash, height : Int32 height, height=(value : Int32) : Int32 height=, is_activatable : Bool is_activatable, is_expanded : Bool is_expanded, is_expanded=(is_expanded : Bool) : Nil is_expanded=, is_expanded? : Bool is_expanded?, is_expander : Bool is_expander, is_expander=(is_expander : Bool) : Nil is_expander=, is_expander? : Bool is_expander?, mode : Gtk::CellRendererMode mode, mode=(value : Gtk::CellRendererMode) : Gtk::CellRendererMode mode=, padding : Nil padding, preferred_height(widget : Gtk::Widget) : Nil preferred_height, preferred_height_for_width(widget : Gtk::Widget, width : Int32) : Nil preferred_height_for_width, preferred_size(widget : Gtk::Widget) : Gtk::Requisition preferred_size, preferred_width(widget : Gtk::Widget) : Nil preferred_width, preferred_width_for_height(widget : Gtk::Widget, height : Int32) : Nil preferred_width_for_height, request_mode : Gtk::SizeRequestMode request_mode, sensitive : Bool sensitive, sensitive=(sensitive : Bool) : Nil sensitive=, sensitive? : Bool sensitive?, set_alignment(xalign : Float32, yalign : Float32) : Nil set_alignment, set_fixed_size(width : Int32, height : Int32) : Nil set_fixed_size, set_padding(xpad : Int32, ypad : Int32) : Nil set_padding, snapshot(snapshot : Gtk::Snapshot, widget : Gtk::Widget, background_area : Gdk::Rectangle, cell_area : Gdk::Rectangle, flags : Gtk::CellRendererState) : Nil snapshot, start_editing(event : Gdk::Event | Nil, widget : Gtk::Widget, path : String, background_area : Gdk::Rectangle, cell_area : Gdk::Rectangle, flags : Gtk::CellRendererState) : Gtk::CellEditable | Nil start_editing, state(widget : Gtk::Widget | Nil, cell_state : Gtk::CellRendererState) : Gtk::StateFlags state, stop_editing(canceled : Bool) : Nil stop_editing, visible : Bool visible, visible=(visible : Bool) : Nil visible=, visible? : Bool visible?, width : Int32 width, width=(value : Int32) : Int32 width=, xalign : Float32 xalign, xalign=(value : Float32) : Float32 xalign=, xpad : UInt32 xpad, xpad=(value : UInt32) : UInt32 xpad=, yalign : Float32 yalign, yalign=(value : Float32) : Float32 yalign=, ypad : UInt32 ypad, ypad=(value : UInt32) : UInt32 ypad=
Constructor methods inherited from class Gtk::CellRenderer
newnew(*, cell_background : String | Nil = nil, cell_background_rgba : Gdk::RGBA | Nil = nil, cell_background_set : Bool | Nil = nil, editing : Bool | Nil = nil, height : Int32 | Nil = nil, is_expanded : Bool | Nil = nil, is_expander : Bool | Nil = nil, mode : Gtk::CellRendererMode | Nil = nil, sensitive : Bool | Nil = nil, visible : Bool | Nil = nil, width : Int32 | Nil = nil, xalign : Float32 | Nil = nil, xpad : UInt32 | Nil = nil, yalign : Float32 | Nil = nil, ypad : UInt32 | Nil = nil) new
Class methods inherited from class Gtk::CellRenderer
g_type : UInt64
g_type
Instance methods inherited from class GObject::InitiallyUnowned
==(other : self)
==,
hash(hasher)
hash
Constructor methods inherited from class GObject::InitiallyUnowned
new
new
Class methods inherited from class GObject::InitiallyUnowned
g_type : UInt64
g_type
Instance methods inherited from class GObject::Object
==(other : self)
==,
bind_property(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags) : GObject::Binding
bind_property,
bind_property_full(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags, transform_to : GObject::Closure, transform_from : GObject::Closure) : GObject::Binding
bind_property_full,
data(key : String) : Pointer(Void) | Nil
data,
finalize
finalize,
freeze_notify : Nil
freeze_notify,
getv(names : Enumerable(String), values : Enumerable(_)) : Nil
getv,
hash(hasher)
hash,
notify(property_name : String) : Nil
notify,
notify_by_pspec(pspec : GObject::ParamSpec) : Nil
notify_by_pspec,
notify_signal
notify_signal,
property(property_name : String, value : _) : Nil
property,
qdata(quark : UInt32) : Pointer(Void) | Nil
qdata,
ref_count : UInt32
ref_count,
run_dispose : Nil
run_dispose,
set_data(key : String, data : Pointer(Void) | Nil) : Nil
set_data,
set_property(property_name : String, value : _) : Nil
set_property,
steal_data(key : String) : Pointer(Void) | Nil
steal_data,
steal_qdata(quark : UInt32) : Pointer(Void) | Nil
steal_qdata,
thaw_notify : Nil
thaw_notify,
to_unsafe : Pointer(Void)
to_unsafe,
watch_closure(closure : GObject::Closure) : Nil
watch_closure
Constructor methods inherited from class GObject::Object
cast(obj : GObject::Object) : self
cast,
new(pointer : Pointer(Void), transfer : GICrystal::Transfer)new new, newv(object_type : UInt64, parameters : Enumerable(GObject::Parameter)) : self newv
Class methods inherited from class GObject::Object
cast?(obj : GObject::Object) : self | Nil
cast?,
compat_control(what : UInt64, data : Pointer(Void) | Nil) : UInt64
compat_control,
g_type : UInt64
g_type,
interface_find_property(g_iface : GObject::TypeInterface, property_name : String) : GObject::ParamSpec
interface_find_property,
interface_list_properties(g_iface : GObject::TypeInterface) : Enumerable(GObject::ParamSpec)
interface_list_properties
Macros inherited from class GObject::Object
previous_vfunc(*args)
previous_vfunc,
previous_vfunc!(*args)
previous_vfunc!,
signal(signature)
signal
Constructor Detail
Creates a new Gtk::CellRendererText
. Adjust how text is drawn using
object properties. Object properties can be
set globally (with g_object_set()). Also, with Gtk::TreeViewColumn
,
you can bind a property to a value in a Gtk::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 Gtk::TreeView
.
Class Method Detail
Returns the type id (GType) registered in GLib type system.
Instance Method Detail
Returns true
if this reference is the same as other. Invokes same?
.
Fills in xalign and yalign with the appropriate values of cell.
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.