[Gtk-sharp-list] How to get the row number of a cell

Pedro Castro noup at users.sourceforge.net
Thu Jan 19 22:22:08 EST 2006

I would like to ask what it is the most efficient way of knowing the row 
number of a cell, when rendering it. Some context:

TreeViewColumn column = new TreeViewColumn();
CellRendererText cell = new CellRendererText();
column.PackStart(cell, false);
column.SetCellDataFunc(cell, new TreeCellDataFunc(RenderCell));

void RenderCell (TreeViewColumn column, CellRenderer cell, TreeModel 
model, TreeIter iter) {
       //get row number and use it

What is the most efficient way to get the row number, inside the 
RenderCell function?

ATM i'm using the following to do it:


Though, having to create a new path when rendering each cell doesn't 
look like the best choice.

More information about the Gtk-sharp-list mailing list