Pygtk线程锁定

时间:2013-12-29 17:25:34

标签: treeview pygtk

示例代码http://bpaste.net/show/162777/

如何使用thread添加到treeview.model中:

class UpdateTV(threading.Thread):
    def __init__(self, tv, iter):
        super(UpdateTV, self).__init__()
        self.tv = tv
        self.iter = iter
        self.status_run = False

    def run(self):        
        self.status_run = True
        model = self.tv.get_model()
        for i in range(10):
            if not self.status_run:
                break
            model.append(self.iter, ["Added_node#", str(i)])

0 个答案:

没有答案