def populate_tree(self, element, parent_id=""):
"""
Recursively populate the Treeview.
Also populates the *id_cfgstrings*.
"""
# insert into the Treeview
element.treeview_id = self.treeview.insert(parent_id, "end", text=element.name, open=True)
# add id-element pair to dictionary
self.element_dict[element.treeview_id] = element
# set information fields
self.set_treeview_properties(element)
# populate for children
if element.children is not None:
for child in element.children:
self.populate_tree(child, parent_id=element.treeview_id)
评论列表
文章目录