Class
GtkCellRendererText
Description [src]
class Gtk.CellRendererText : Gtk.CellRenderer {
parent: GtkCellRenderer
}
Renders text in a cell
A GtkCellRendererText
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 GtkCellRendererText:ellipsize
property allows it.
If the GtkCellRenderer:mode
is GTK_CELL_RENDERER_MODE_EDITABLE
,
the GtkCellRendererText
allows to edit its text using an entry.
Ancestors
- GtkCellRenderer
- GInitiallyUnowned
- GObject
Constructors
gtk_cell_renderer_text_new
Creates a new GtkCellRendererText
. Adjust how text is drawn using
object properties. Object properties can be
set globally (with g_object_set()
). Also, with GtkTreeViewColumn
,
you can bind a property to a value in a GtkTreeModel
. 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 GtkTreeView
.
Instance methods
gtk_cell_renderer_text_set_fixed_height_from_font
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.
Methods inherited from GtkCellRenderer (27)
gtk_cell_renderer_activate
Passes an activate event to the cell renderer for possible processing.
Some cell renderers may use events; for example, GtkCellRendererToggle
toggles when it gets a mouse click.
gtk_cell_renderer_get_aligned_area
Gets the aligned area used by cell
inside cell_area
. Used for finding
the appropriate edit and focus rectangle.
gtk_cell_renderer_get_alignment
Fills in xalign
and yalign
with the appropriate values of cell
.
gtk_cell_renderer_get_fixed_size
Fills in width
and height
with the appropriate size of cell
.
gtk_cell_renderer_get_is_expanded
Checks whether the given GtkCellRenderer
is expanded.
gtk_cell_renderer_get_is_expander
Checks whether the given GtkCellRenderer
is an expander.
gtk_cell_renderer_get_padding
Fills in xpad
and ypad
with the appropriate values of cell
.
gtk_cell_renderer_get_preferred_height
Retrieves a renderer’s natural size when rendered to widget
.
gtk_cell_renderer_get_preferred_height_for_width
Retrieves a cell renderers’s minimum and natural height if it were rendered to
widget
with the specified width
.
gtk_cell_renderer_get_preferred_size
Retrieves the minimum and natural size of a cell taking into account the widget’s preference for height-for-width management.
gtk_cell_renderer_get_preferred_width
Retrieves a renderer’s natural size when rendered to widget
.
gtk_cell_renderer_get_preferred_width_for_height
Retrieves a cell renderers’s minimum and natural width if it were rendered to
widget
with the specified height
.
gtk_cell_renderer_get_request_mode
Gets whether the cell renderer prefers a height-for-width layout or a width-for-height layout.
gtk_cell_renderer_get_sensitive
Returns the cell renderer’s sensitivity.
gtk_cell_renderer_get_state
Translates the cell renderer state to GtkStateFlags
,
based on the cell renderer and widget sensitivity, and
the given GtkCellRenderer
State.
gtk_cell_renderer_get_visible
Returns the cell renderer’s visibility.
gtk_cell_renderer_is_activatable
Checks whether the cell renderer can do something when activated.
gtk_cell_renderer_set_alignment
Sets the renderer’s alignment within its available space.
gtk_cell_renderer_set_fixed_size
Sets the renderer size to be explicit, independent of the properties set.
gtk_cell_renderer_set_is_expanded
Sets whether the given GtkCellRenderer
is expanded.
gtk_cell_renderer_set_is_expander
Sets whether the given GtkCellRenderer
is an expander.
gtk_cell_renderer_set_padding
Sets the renderer’s padding.
gtk_cell_renderer_set_sensitive
Sets the cell renderer’s sensitivity.
Properties
Gtk.CellRendererText:align-set
Gtk.CellRendererText:alignment
Specifies how to align the lines of text with respect to each other.
Gtk.CellRendererText:attributes
Gtk.CellRendererText:background
Gtk.CellRendererText:background-rgba
Background color as a GdkRGBA
Gtk.CellRendererText:background-set
Gtk.CellRendererText:editable
Gtk.CellRendererText:editable-set
Gtk.CellRendererText:ellipsize
Specifies the preferred place to ellipsize the string, if the cell renderer
does not have enough room to display the entire string. Setting it to
PANGO_ELLIPSIZE_NONE
turns off ellipsizing. See the wrap-width property
for another way of making the text fit into a given width.
Gtk.CellRendererText:ellipsize-set
Gtk.CellRendererText:family
Gtk.CellRendererText:family-set
Gtk.CellRendererText:font
Gtk.CellRendererText:font-desc
Gtk.CellRendererText:foreground
Gtk.CellRendererText:foreground-rgba
Foreground color as a GdkRGBA
Gtk.CellRendererText:foreground-set
Gtk.CellRendererText:language
Gtk.CellRendererText:language-set
Gtk.CellRendererText:markup
Gtk.CellRendererText:max-width-chars
The desired maximum width of the cell, in characters. If this property is set to -1, the width will be calculated automatically.
Gtk.CellRendererText:placeholder-text
The text that will be displayed in the GtkCellRenderer
if
GtkCellRendererText:editable
is TRUE
and the cell is empty.
Gtk.CellRendererText:rise
Gtk.CellRendererText:rise-set
Gtk.CellRendererText:scale
Gtk.CellRendererText:scale-set
Gtk.CellRendererText:single-paragraph-mode
Gtk.CellRendererText:size
Gtk.CellRendererText:size-points
Gtk.CellRendererText:size-set
Gtk.CellRendererText:stretch
Gtk.CellRendererText:stretch-set
Gtk.CellRendererText:strikethrough
Gtk.CellRendererText:strikethrough-set
Gtk.CellRendererText:style
Gtk.CellRendererText:style-set
Gtk.CellRendererText:text
Gtk.CellRendererText:underline
Gtk.CellRendererText:underline-set
Gtk.CellRendererText:variant
Gtk.CellRendererText:variant-set
Gtk.CellRendererText:weight
Gtk.CellRendererText:weight-set
Gtk.CellRendererText:width-chars
The desired width of the cell, in characters. If this property is set to -1, the width will be calculated automatically, otherwise the cell will request either 3 characters or the property value, whichever is greater.
Gtk.CellRendererText:wrap-mode
Specifies how to break the string into multiple lines, if the cell renderer does not have enough room to display the entire string. This property has no effect unless the wrap-width property is set.
Gtk.CellRendererText:wrap-width
Specifies the minimum width at which the text is wrapped. The wrap-mode property can be used to influence at what character positions the line breaks can be placed. Setting wrap-width to -1 turns wrapping off.
Properties inherited from GtkCellRenderer (15)
Gtk.CellRenderer:cell-background
Gtk.CellRenderer:cell-background-rgba
Cell background as a GdkRGBA
Gtk.CellRenderer:cell-background-set
Gtk.CellRenderer:editing
Gtk.CellRenderer:height
Gtk.CellRenderer:is-expanded
Gtk.CellRenderer:is-expander
Gtk.CellRenderer:mode
Gtk.CellRenderer:sensitive
Gtk.CellRenderer:visible
Gtk.CellRenderer:width
Gtk.CellRenderer:xalign
Gtk.CellRenderer:xpad
Gtk.CellRenderer:yalign
Gtk.CellRenderer:ypad
Signals
Gtk.CellRendererText::edited
This signal is emitted after renderer
has been edited.
Signals inherited from GtkCellRenderer (2)
Gtk.CellRenderer::editing-canceled
This signal gets emitted when the user cancels the process of editing a cell. For example, an editable cell renderer could be written to cancel editing when the user presses Escape.
Gtk.CellRenderer::editing-started
This signal gets emitted when a cell starts to be edited.
The intended use of this signal is to do special setup
on editable
, e.g. adding a GtkEntryCompletion
or setting
up additional columns in a GtkComboBox
.
Class structure
struct GtkCellRendererTextClass {
GtkCellRendererClass parent_class;
void (* edited) (
GtkCellRendererText* cell_renderer_text,
const char* path,
const char* new_text
);
}
Class members
parent_class |
|
No description available. | |
edited |
|
No description available. |