Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pygtk - how update a gtk.liststore?

Tags:

python

pygtk

http://img824.imageshack.us/i/capturadetelag.png/

how update a gtk.liststore?

i mean get a random number every second on a column just like example, such as a download manager list, i'd like to have a simple example to know how this Liststore works for update the list, because i can't find a effective way to do something like a:

store.append(list1,list2,list3)

store.update(list3,['foobar']).

like image 679
killown Avatar asked Dec 10 '22 15:12

killown


1 Answers

You can iterate over the rows in a list store (for row in liststore:...) as well as over the columns (values) in each row (for col_value in row:...).

For simple, direct updates:

row_n = 0
col_n = 2
liststore[row_n][col_n] = 'new value'

Otherwise, you can update using a gtk.TreeIter (row_iter):

liststore.set_value(row_iter, col_n, 'new value')
like image 69
Walter Avatar answered Dec 12 '22 03:12

Walter