开发者

pygtk: invalid treeview iter

I have a somewhat complicated set-up for a treeview. This is how the view is set up:

        self.hsModel = gtk.TreeStore(*[c[0] for c in columns])
        self.hsModelFilter = self.hsModel.filter_new()
        self.hsModelSort = gtk.TreeModelSort(self.hsModelFilter)
        self.hsSelect = gtk.TreeView(self.hsModelSort)

That is, I have a model, then I filter it, then I sort it, then the view displays the sorted model. In a function, I append something to the base model:

iter = self.hsModel.append(None, row)

Then I attempt to select what I just added from the tree view (hsSelect):

            fiter = self.hsModelFilter.convert_child_iter_to_iter(iter)
            siter = self.hsModelSort.convert_child_iter_to_iter(None, fiter)
            self.hsSelect.get_selection().select_iter(siter)

However, this sometimes gives an error. I can't reproduce it now, but it says the iter's stamp doesn't match the tree model's stamp. Any开发者_如何学Go idea what I'm doing incorrectly?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜