Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roll back the need to pass a Tree to the tree messages #2529

Closed
davep opened this issue May 9, 2023 · 1 comment · Fixed by #2602
Closed

Roll back the need to pass a Tree to the tree messages #2529

davep opened this issue May 9, 2023 · 1 comment · Fixed by #2602
Labels
enhancement New feature or request Task

Comments

@davep
Copy link
Contributor

davep commented May 9, 2023

The following Tree messages:

  • Tree.NodeCollapsed
  • Tree.NodeExpanded
  • Tree.NodeHighlighted
  • Tree.NodeSelected
  • DirectoryTree.FileSelected

all recently acquired an __init__ parameter that is the Tree they're related to; this was done to service the addition of control properties on all of those messages. That parameter isn't really necessary because each message knows about its node and the node knows its tree. So control can be written like this:

def control(self) -> Tree:
    return self.node.tree
@github-actions
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant