Next: , Previous: GtkTreeView drag-and-drop, Up: Top


37 GtkCellView

A widget displaying a single row of a GtkTreeModel

37.1 Overview

A <gtk-cell-view> displays a single row of a <gtk-tree-model>, using cell renderers just like <gtk-tree-view>. <gtk-cell-view> doesn't support some of the more complex features of <gtk-tree-view>, like cell editing and drag and drop.

37.2 Usage

— Class: <gtk-cell-view>

Derives from <gtk-cell-layout>, <gtk-widget>.

This class defines the following slots:

background
Background color as a string
background-gdk
Background color as a GdkColor
background-set
Whether this tag affects the background color
model
The model for cell view
— Function: gtk-cell-view-new ⇒  (ret <gtk-widget>)

Creates a new <gtk-cell-view> widget.

ret
A newly created <gtk-cell-view> widget.

Since 2.6

— Function: gtk-cell-view-new-with-text (text mchars) ⇒  (ret <gtk-widget>)

Creates a new <gtk-cell-view> widget, adds a <gtk-cell-renderer-text> to it, and makes its show text.

text
the text to display in the cell view
ret
A newly created <gtk-cell-view> widget.

Since 2.6

— Function: gtk-cell-view-new-with-markup (markup mchars) ⇒  (ret <gtk-widget>)

Creates a new <gtk-cell-view> widget, adds a <gtk-cell-renderer-text> to it, and makes its show markup. The text can text can be marked up with the Pango text markup language.

markup
the text to display in the cell view
ret
A newly created <gtk-cell-view> widget.

Since 2.6

— Function: gtk-cell-view-new-with-pixbuf (pixbuf <gdk-pixbuf>) ⇒  (ret <gtk-widget>)

Creates a new <gtk-cell-view> widget, adds a <gtk-cell-renderer-pixbuf> to it, and makes its show pixbuf.

pixbuf
the image to display in the cell view
ret
A newly created <gtk-cell-view> widget.

Since 2.6

— Function: gtk-cell-view-set-model (self <gtk-cell-view>) (model <gtk-tree-model>)
— Method: set-model

Sets the model for cell-view. If cell-view already has a model set, it will remove it before setting the new model. If model is ‘#f’, then it will unset the old model.

cell-view
a <gtk-cell-view>
model
a <gtk-tree-model>

Since 2.6

— Function: gtk-cell-view-set-displayed-row (self <gtk-cell-view>) (path <gtk-tree-path>)
— Method: set-displayed-row

Sets the row of the model that is currently displayed by the <gtk-cell-view>. If the path is unset, then the contents of the cellview "stick" at their last value; this is not normally a desired result, but may be a needed intermediate state if say, the model for the <gtk-cell-view> becomes temporarily empty.

cell-view
a <gtk-cell-view>
path
a <gtk-tree-path> or ‘#f’ to unset.

Since 2.6

— Function: gtk-cell-view-get-displayed-row (self <gtk-cell-view>) ⇒  (ret <gtk-tree-path>)
— Method: get-displayed-row

Returns a <gtk-tree-path> referring to the currently displayed row. If no row is currently displayed, ‘#f’ is returned.

cell-view
a <gtk-cell-view>
ret
the currently displayed row or ‘#f

Since 2.6

— Function: gtk-cell-view-get-size-of-row (self <gtk-cell-view>) (path <gtk-tree-path>) (requisition <gtk-requisition>) ⇒  (ret bool)
— Method: get-size-of-row

Sets requisition to the size needed by cell-view to display the model row pointed to by path.

cell-view
a <gtk-cell-view>
path
a <gtk-tree-path>
requisition
return location for the size
ret
#t

Since 2.6

— Function: gtk-cell-view-set-background-color (self <gtk-cell-view>) (color <gdk-color>)
— Method: set-background-color

Sets the background color of view.

cell-view
a <gtk-cell-view>
color
the new background color

Since 2.6

— Function: gtk-cell-view-get-cell-renderers (self <gtk-cell-view>) ⇒  (ret glist-of)
— Method: get-cell-renderers

Returns the cell renderers which have been added to cell-view.

cell-view
a <gtk-cell-view>
ret
a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g-list-free when no longer needed.

Since 2.6