Commit Graph

3 Commits

Author SHA1 Message Date
Dave Pearson
494c63a72b Tweak the unknown node ID exception
See https://github.com/Textualize/textual/pull/1535#discussion_r1065904713
and https://github.com/Textualize/textual/pull/1535#discussion_r1065909144
2023-01-10 15:28:17 +00:00
Dave Pearson
728acc27c0 Introduce an exception specific to handling an unknown node ID
See https://github.com/Textualize/textual/pull/1535#discussion_r1065873649
2023-01-10 14:57:35 +00:00
Dave Pearson
6ea68cc112 Add Tree.get_node_by_id
The thinking here is that a user of a Tree may want to relate notes to other
parts of their UI, or other data in their application. While this could be
done by keeping a reference to the node itself, it could also be beneficial
to just track the ID. Given that ID is a public property of a TreeNode, but
given it doesn't currently have any other (public) purpose, this seems to
add some useful symmetry.
2023-01-10 10:42:07 +00:00