双击检索树视图数据

时间:2016-02-22 22:18:04

标签: python python-3.x gtk gtk3

我试图通过双击(treeview信号)来检索row-activated数据。 我现在已经设法通过changed信号做到:

self.view.get_selection().connect("changed", self.row_activated)
def row_activated(self, selection):
    (model, iter) = selection.get_selected()
    print(model[iter][:])
    return True

但我无法使用row-activated

进行管理
self.view.connect("row-activated", self.row_activated)
def row_activated(self):
    (model, iter) = self.view.get_selected()
    print(model[iter][:])
    return True

但是,这是错误的:

TypeError: row_activated() takes 1 positional argument but 4 were given

1 个答案:

答案 0 :(得分:3)

回答我自己的问题很奇怪,但我设法将其解决为:

{{1}}