Process the label on construction of a TreeNode

Currently there's an asymmetry in how the label is handled for a TreeNode.
If a str label is passed to the constructor it stays as a str type. On the
other hand, if it's set via set_label, it gets processed into a Rich Text
type. This commit removes that asymmetry.
This commit is contained in:
Dave Pearson
2023-01-05 09:21:52 +00:00
parent aaad1a310a
commit a1e63a1c02

View File

@@ -71,7 +71,7 @@ class TreeNode(Generic[TreeDataType]):
self._tree = tree
self._parent = parent
self._id = id
self._label = label
self._label = tree.process_label(label)
self.data = data
self._expanded = expanded
self._children: list[TreeNode] = []