Thanks Osmo, worked like a charm!

/Fredrik

On 5/9/07, Osmo Salomaa <[EMAIL PROTECTED]> wrote:
ti, 2007-05-08 kello 10:59 +0200, Fredrik Corneliusson kirjoitti:
> I wonder about the best way to add row numbers to a gtk.TreeView with
> a gtk.ListStore model.

I believe the best way is to add an integer column to the list store and
use 'set_cell_data_func' as follows to set the row number to update
automatically after whatever changes in the list store.

def set_row_number(column, renderer, store, itr):
    renderer.props.text = store.get_path(itr)[0] + 1
column.set_cell_data_func(renderer, set_row_number)

--
Osmo Salomaa


_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to