我有这样的GtkTreeView
+++++++++++++++++++++++
+ Name + Age +
+++++++++++++++++++++++
+ Adam + 15 +
+ Jane + 19 +
+ Arnold + 23 +<
+ Russell + 10 +
+++++++++++++++++++++++
如果我选择了阿诺德,那么我就知道我选择了阿诺德
selection = self.viewFriends.get_selection()
model, tree_iter = selection.get_selected()
print model[tree_iter][0]
如何获得模型中与Arnold记录相对应的实际对象?你知道吗
调用GtkTreeIter
时收到的get_selected()
对象总是一个新对象。你知道吗
您可以将标题设置为可单击,然后将其“clicked”事件绑定到将获取其行ID的函数/方法。然后可以使用此函数将数据成员设置为更改的ID
相关问题 更多 >
编程相关推荐