def refresh_treeview(self):
"""
Clears the Treeview and repopulates it with the current contents of the tree.
"""
# clear the entries in the Treeview
for x in self.treeview.get_children():
self.treeview.delete(x)
# clear the id-element dictionary
# elements may be given new id's after repopulation
self.element_dict.clear()
# repopulate
if self.root_element is not None:
self.populate_tree(self.root_element)
评论列表
文章目录