在关闭该文件之前将光标设置在与在 TreeView 中选择的位置相同的位置,并且在重新打开文件时我想将该光标设置在相同的位置。我使用 pygtk 和 python 完成了这项工作。
请您参考如下方法:
last_path = treeview.get_cursor()[0]
## do whatever you want, then finally:
treeview.set_cursor(last_path)
treeview.scroll_to_cell(last_path)
在关闭该文件之前将光标设置在与在 TreeView 中选择的位置相同的位置,并且在重新打开文件时我想将该光标设置在相同的位置。我使用 pygtk 和 python 完成了这项工作。
请您参考如下方法:
last_path = treeview.get_cursor()[0]
## do whatever you want, then finally:
treeview.set_cursor(last_path)
treeview.scroll_to_cell(last_path)