【发布时间】:2019-03-19 07:55:00
【问题描述】:
我正在插入一个新项目,例如:
# Insert new item as child of current item
tree.insert(current_node_iid, 1, text="New note")
我可以将焦点设置在一个项目上:
# Must select and then focus using the iid of an item
tree.selection_set("I001")
tree.focus("I001")
但是如果我插入一个新项目,并且我让 Python 设置新项目的索引,那么我不知道这个新索引,因此我无法将焦点设置在新项目上。
我当然可以指定新项目的 iid,但是我必须检查 iid 是否已被另一个项目使用,我不知道该怎么做。
如何将焦点设置在新项目上?
感谢任何帮助。提前谢谢。
【问题讨论】: