Next: , Previous: GtkCellRendererAccel, Up: Top

46 GtkCellRendererCombo

Renders a combobox in a cell

46.1 Overview

<gtk-cell-renderer-combo> renders text in a cell like <gtk-cell-renderer-text> from which it is derived. But while <gtk-cell-renderer-text> offers a simple entry to edit the text, <gtk-cell-renderer-combo> offers a <gtk-combo-box> or <gtk-combo-box-entry> widget to edit the text. The values to display in the combo box are taken from the tree model specified in the model property.

The combo cell renderer takes care of adding a text cell renderer to the combo box and sets it to display the column specified by its text-column property. Further properties of the comnbo box can be set in a handler for the editing-started signal.

The <gtk-cell-renderer-combo> cell renderer was added in GTK+ 2.6.

46.2 Usage

— Class: <gtk-cell-renderer-combo>

Derives from <gtk-cell-renderer-text>.

This class defines the following slots:

The model containing the possible values for the combo box
A column in the data source model to get the strings from
If FALSE, don't allow to enter strings other than the chosen ones
— Function: gtk-cell-renderer-combo-new ⇒  (ret <gtk-cell-renderer>)

Creates a new <gtk-cell-renderer-combo>. Adjust how text is drawn using object properties. Object properties can be set globally (with g-object-set). Also, with <gtk-tree-view-column>, you can bind a property to a value in a <gtk-tree-model>. 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-tree-view>.

the new cell renderer

Since 2.6