On Wed, 12 Oct 2011 11:29:59 +0200, Olaf Devik wrote:
I am struggling with TreeView and CellRendererText.

I have a ListStore containing a number of fields with strings and
integers. The ListStore is connected to a TreeView and the string
fields render well as expected, but the fields with integers will not
render.

How can I render integer values in the TreeView?

Exactly like you would render a string value from your model. For
example, assuming field 1 in your model is of type int:

cell = gtk.CellRendererText()
intcolumn = gtk.TreeViewColumn('Amount')
intcolumn.pack_start(cell, True)
intcolumn.add_attribute(cell, 'text', 1)

A complete and working example is attached.

mvg,
Dieter

Attachment: treeview_columns.py
Description: application/python

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

Reply via email to