pygtk - 如何更新 gtk.liststore?
http://img824.imageshack.us/i/capturadetelag.png/
如何更新 gtk.liststore?
我的意思是每秒在列上获取一个随机数,就像示例一样, 例如下载管理器列表,我想有一个简单的例子来了解这个Liststore如何 适用于更新列表,因为我找不到有效的方法来执行以下操作:
store.append(list1,list2,list3)
store.update(list3,['foobar'])。
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']).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以迭代列表存储中的行(
for row in liststore:...
)以及每行中的列(值)(for col_value in row:.. .
)。对于简单、直接的更新:
否则,您可以使用
gtk.TreeIter
(row_iter
) 进行更新: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:
Otherwise, you can update using a
gtk.TreeIter
(row_iter
):gtk.ListStore
您需要使用 gtk.TreeIter,还有这有一些很好的信息。
如果我更熟悉的话我可以给你一个例子,我只记得使用 gtk.liststore 有点痛苦,但实际上没有更好的解决方案
gtk.ListStore
You need to use a gtk.TreeIter, also this has some good information.
If I were more familiar I could give you an example, I just remember that it's kind of a pain to use the gtk.liststore, but there's not really any better solution