Name

gtk.CellRendererText — an object that renders text into a gtk.TreeView cell

Synopsis

class gtk.CellRendererText(gtk.CellRenderer):
    gtk.CellRendererText()
def set_fixed_height_from_font(number_of_rows)

Ancestry

+-- gobject.GObject
  +-- gtk.Object
    +-- gtk.CellRenderer
      +-- gtk.CellRendererText

Properties

"text"Read/WriteText to render
"markup"Read/WriteMarked up text to render
"attributes"Read/WriteA list of style attributes to apply to the text of the renderer.
"background"WriteBackground color as a string
"foreground"WriteForeground color as a string
"background-gdk"Read/WriteBackground color as a gtk.gdk.Color
"foreground-gdk"Read/WriteForeground color as a gtk.gdk.Color
"font"Read/WriteFont description as a string
"font-desc"Read/WriteFont description as a pango.FontDescription
"family"Read/WriteName of the font family, e.g. Sans, Helvetica, Times, Monospace
"style"Read/WriteFont style
"variant"Read/WriteFont variant
"weight"Read/WriteFont weight
"stretch"Read/WriteFont stretch
"size"Read/WriteFont size
"size-points"Read/WriteFont size in points
"scale"Read/WriteFont scaling factor
"editable"Read/WriteIf TRUE the text can be modified by the user
"strikethrough"Read/WriteIf TRUE strike through the text
"underline"Read/WriteStyle of underline for this text
"rise"Read/WriteOffset of text above the baseline (below the baseline if rise is negative)
"language"Read/WriteThe 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. GTK+ 2.4 and above.
"single-paragraph-mode"Read/WriteIf TRUE, keep all text in a single paragraph. GTK+ 2.4 and above.
"background-set"Read/WriteIf TRUE this tag affects the background color
"foreground-set"Read/WriteIf TRUE this tag affects the foreground color
"family-set"Read/WriteIf TRUE this tag affects the font family
"style-set"Read/WriteIf TRUE this tag affects the font style
"variant-set"Read/WriteIf TRUE this tag affects the font variant
"weight-set"Read/WriteIf TRUE this tag affects the font weight
"stretch-set"Read/WriteIf TRUE this tag affects the font stretch
"size-set"Read/WriteIf TRUE this tag affects the font size
"scale-set"Read/WriteIf TRUE this tag scales the font
"editable-set"Read/WriteIf TRUE this tag affects the text editability
"strikethrough-set"Read/WriteIf TRUE this tag affects the strikethrough
"underline-set"Read/WriteIf TRUE this tag affects the text underlining
"rise-set"Read/WriteIf TRUE this tag affects the rise
"language-set"Read/WriteIf TRUE this tag affects the language used to render the text. GTK+ 2.4 and above.

Signal Prototypes

"edited" def callback(cellrenderertext, path, new_text, user_param1, ...)

Description

The gtk.CellRendererText manages the rendering of text into a gtk.TreeView cell.

Constructor

    gtk.CellRendererText()
Returns :the new cell renderer

Creates a new gtk.CellRendererText. The way that text is drawn is changed using object properties. The object properties can be set globally (with set_property()). 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.

Methods

gtk.CellRendererText.set_fixed_height_from_font

    def set_fixed_height_from_font(number_of_rows)
number_of_rows :Number of rows of text each cell renderer is allocated, or -1

The set_fixed_height_from_font() sets the height of a renderer to explicitly be determined by the "font" and "ypad" properties set on it. This method must be called each time these properties are changed to affect the height. This function is inflexible, and should really only be used if calculating the size of a cell is too slow (i.e. 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.

Signals

The "edited" gtk.CellRendererText Signal

    def callback(cellrenderertext, path, new_text, user_param1, ...)
cellrenderertext :the cellrenderertext that received the "edited" signal
path :the path string of the cellrenderertext
new_text :the new text of the cellrenderertext
user_param1 :the first user parameter (if any) specified with the connect() method
... :additional user parameters (if any)

The "edited" signal is emitted when the text in the cell has been edited.