Inserts a node into the tree. This is how user builds their tree, by Inserting Nodes This is the ONLY user callable method in the TreeData class :param parent: the parent Node :type parent: (Node) :param key: Used to uniquely identify this node :
(self, parent, key, text, values, icon=None)
| 9577 | self.tree_dict[key] = node |
| 9578 | |
| 9579 | def insert(self, parent, key, text, values, icon=None): |
| 9580 | """ |
| 9581 | Inserts a node into the tree. This is how user builds their tree, by Inserting Nodes |
| 9582 | This is the ONLY user callable method in the TreeData class |
| 9583 | |
| 9584 | :param parent: the parent Node |
| 9585 | :type parent: (Node) |
| 9586 | :param key: Used to uniquely identify this node |
| 9587 | :type key: str | int | tuple | object |
| 9588 | :param text: The text that is displayed at this node's location |
| 9589 | :type text: (str) |
| 9590 | :param values: The list of values that are displayed at this node |
| 9591 | :type values: List[Any] |
| 9592 | :param icon: icon |
| 9593 | :type icon: str | bytes |
| 9594 | """ |
| 9595 | |
| 9596 | node = self.Node(parent, key, text, values, icon) |
| 9597 | self.tree_dict[key] = node |
| 9598 | parent_node = self.tree_dict[parent] |
| 9599 | parent_node._Add(node) |
| 9600 | |
| 9601 | def __repr__(self): |
| 9602 | """ |
no test coverage detected