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

Modify Message.control so that it is a @property and not a classvar #2528

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

Modify Message.control so that it is a @property and not a classvar #2528

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 current implementation of the control property of Message results in the following type error (in this case taken from DirectoryTree.FileSelected.control:

Screenshot 2023-05-09 at 15 26 11

Change this so that it is a @property on Message, like this:

def control(self) -> Widget | None:
    return None

and then modify the on decorator so that it does the pre-flight check of control by comparing the type's control with Message.control, raising an error if they are the same (not overridden).

@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