GtkCellRendererText

GtkCellRendererText — Renders text in a cell

Synopsis


#include <gtk/gtk.h>


            GtkCellRendererText;
GtkCellRenderer* gtk_cell_renderer_text_new (void);
void        gtk_cell_renderer_text_set_fixed_height_from_font
                                            (GtkCellRendererText *renderer,
                                             gint number_of_rows);


Object Hierarchy


  GObject
   +----GtkObject
         +----GtkCellRenderer
               +----GtkCellRendererText
                     +----GtkCellRendererCombo

Properties


  "attributes"           PangoAttrList         : Read / Write
  "background"           gchararray            : Write
  "background-gdk"       GdkColor              : Read / Write
  "background-set"       gboolean              : Read / Write
  "editable"             gboolean              : Read / Write
  "editable-set"         gboolean              : Read / Write
  "ellipsize"            PangoEllipsizeMode    : Read / Write
  "ellipsize-set"        gboolean              : Read / Write
  "family"               gchararray            : Read / Write
  "family-set"           gboolean              : Read / Write
  "font"                 gchararray            : Read / Write
  "font-desc"            PangoFontDescription  : Read / Write
  "foreground"           gchararray            : Write
  "foreground-gdk"       GdkColor              : Read / Write
  "foreground-set"       gboolean              : Read / Write
  "language"             gchararray            : Read / Write
  "language-set"         gboolean              : Read / Write
  "markup"               gchararray            : Write
  "rise"                 gint                  : Read / Write
  "rise-set"             gboolean              : Read / Write
  "scale"                gdouble               : Read / Write
  "scale-set"            gboolean              : Read / Write
  "single-paragraph-mode" gboolean              : Read / Write
  "size"                 gint                  : Read / Write
  "size-points"          gdouble               : Read / Write
  "size-set"             gboolean              : Read / Write
  "stretch"              PangoStretch          : Read / Write
  "stretch-set"          gboolean              : Read / Write
  "strikethrough"        gboolean              : Read / Write
  "strikethrough-set"    gboolean              : Read / Write
  "style"                PangoStyle            : Read / Write
  "style-set"            gboolean              : Read / Write
  "text"                 gchararray            : Read / Write
  "underline"            PangoUnderline        : Read / Write
  "underline-set"        gboolean              : Read / Write
  "variant"              PangoVariant          : Read / Write
  "variant-set"          gboolean              : Read / Write
  "weight"               gint                  : Read / Write
  "weight-set"           gboolean              : Read / Write
  "width-chars"          gint                  : Read / Write

Signal Prototypes


"edited"    void        user_function      (GtkCellRendererText *cellrenderertext,
                                            gchar *arg1,
                                            gchar *arg2,
                                            gpointer user_data);

Description

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 ellipsize property allows it.

If the mode is GTK_CELL_RENDERER_MODE_EDITABLE, the GtkCellRendererText allows to edit its text using an entry.

Details

GtkCellRendererText

typedef struct _GtkCellRendererText GtkCellRendererText;


gtk_cell_renderer_text_new ()

GtkCellRenderer* gtk_cell_renderer_text_new (void);

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

Returns : the new cell renderer

gtk_cell_renderer_text_set_fixed_height_from_font ()

void        gtk_cell_renderer_text_set_fixed_height_from_font
                                            (GtkCellRendererText *renderer,
                                             gint number_of_rows);

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 unflexible, 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.

renderer : A GtkCellRendererText
number_of_rows : Number of rows of text each cell renderer is allocated, or -1

Properties

The "attributes" property

  "attributes"           PangoAttrList         : Read / Write

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


The "background" property

  "background"           gchararray            : Write

Background color as a string.


The "background-gdk" property

  "background-gdk"       GdkColor              : Read / Write

Background color as a GdkColor.


The "background-set" property

  "background-set"       gboolean              : Read / Write

Whether this tag affects the background color.


The "editable" property

  "editable"             gboolean              : Read / Write

Whether the text can be modified by the user.


The "editable-set" property

  "editable-set"         gboolean              : Read / Write

Whether this tag affects text editability.


The "ellipsize" property

  "ellipsize"            PangoEllipsizeMode    : Read / Write

The preferred place to ellipsize the string, if the cell renderer does not have enough room to display the entire string, if at all.


The "ellipsize-set" property

  "ellipsize-set"        gboolean              : Read / Write

Whether this tag affects the ellipsize mode.


The "family" property

  "family"               gchararray            : Read / Write

Name of the font family, e.g. Sans, Helvetica, Times, Monospace.


The "family-set" property

  "family-set"           gboolean              : Read / Write

Whether this tag affects the font family.


The "font" property

  "font"                 gchararray            : Read / Write

Font description as a string.


The "font-desc" property

  "font-desc"            PangoFontDescription  : Read / Write

Font description as a PangoFontDescription struct.


The "foreground" property

  "foreground"           gchararray            : Write

Foreground color as a string.


The "foreground-gdk" property

  "foreground-gdk"       GdkColor              : Read / Write

Foreground color as a GdkColor.


The "foreground-set" property

  "foreground-set"       gboolean              : Read / Write

Whether this tag affects the foreground color.


The "language" property

  "language"             gchararray            : Read / Write

The language this text is in, as an ISO code. Pango can use this as a hint when rendering the text. If you don't understand this parameter, you probably don't need it.


The "language-set" property

  "language-set"         gboolean              : Read / Write

Whether this tag affects the language the text is rendered as.


The "markup" property

  "markup"               gchararray            : Write

Marked up text to render.


The "rise" property

  "rise"                 gint                  : Read / Write

Offset of text above the baseline (below the baseline if rise is negative).


The "rise-set" property

  "rise-set"             gboolean              : Read / Write

Whether this tag affects the rise.


The "scale" property

  "scale"                gdouble               : Read / Write

Font scaling factor.


The "scale-set" property

  "scale-set"            gboolean              : Read / Write

Whether this tag scales the font size by a factor.


The "single-paragraph-mode" property

  "single-paragraph-mode" gboolean              : Read / Write

Whether or not to keep all text in a single paragraph.


The "size" property

  "size"                 gint                  : Read / Write

Font size.


The "size-points" property

  "size-points"          gdouble               : Read / Write

Font size in points.


The "size-set" property

  "size-set"             gboolean              : Read / Write

Whether this tag affects the font size.


The "stretch" property

  "stretch"              PangoStretch          : Read / Write

Font stretch.


The "stretch-set" property

  "stretch-set"          gboolean              : Read / Write

Whether this tag affects the font stretch.


The "strikethrough" property

  "strikethrough"        gboolean              : Read / Write

Whether to strike through the text.


The "strikethrough-set" property

  "strikethrough-set"    gboolean              : Read / Write

Whether this tag affects strikethrough.


The "style" property

  "style"                PangoStyle            : Read / Write

Font style.


The "style-set" property

  "style-set"            gboolean              : Read / Write

Whether this tag affects the font style.


The "text" property

  "text"                 gchararray            : Read / Write

Text to render.


The "underline" property

  "underline"            PangoUnderline        : Read / Write

Style of underline for this text.


The "underline-set" property

  "underline-set"        gboolean              : Read / Write

Whether this tag affects underlining.


The "variant" property

  "variant"              PangoVariant          : Read / Write

Font variant.


The "variant-set" property

  "variant-set"          gboolean              : Read / Write

Whether this tag affects the font variant.


The "weight" property

  "weight"               gint                  : Read / Write

Font weight.


The "weight-set" property

  "weight-set"           gboolean              : Read / Write

Whether this tag affects the font weight.


The "width-chars" property

  "width-chars"          gint                  : Read / Write

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.

Since 2.6

Signals

The "edited" signal

void        user_function                  (GtkCellRendererText *cellrenderertext,
                                            gchar *arg1,
                                            gchar *arg2,
                                            gpointer user_data);

cellrenderertext :the object which received the signal.
arg1 :
arg2 :
user_data :user data set when the signal handler was connected.