hi, i am having a issue with treeview liststore trying to get a real-time update, and I created a example to simulate what I'd like to do. I want liststore1 updated each loop.
http://img204.imageshack.us/i/capturadetela5.png/
it should update the treeview column 'speed' and give to it a different number every second, something like a download manager.
import gtk
import gtk.glade
import random
builder = gtk.Builder()
builder.add_from_file('ttt.glade')
window = builder.get_object('window1')
treeview = builder.get_object('treeview1')
store = builder.get_object('liststore1')
column_n = ['File','Size','Speed']
rendererText = gtk.CellRendererText()
for i in range(10):
foo = random.randint(100,256)
list_ = [('arquivo1.tar.gz', '10MB', '%s k/s' % foo)]
for x,y in zip(column_n,range(3)):
column = gtk.TreeViewColumn(x, rendererText, text=y)
column.set_sort_column_id(0)
treeview.append_column(column)
for list_index in list_:
store.append([list_index[0],list_index[1],list_index[2]])
window.show_all()