Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Request: action decorator #4973

Closed
darlingm opened this issue Sep 7, 2024 · 1 comment
Closed

Request: action decorator #4973

darlingm opened this issue Sep 7, 2024 · 1 comment

Comments

@darlingm
Copy link

darlingm commented Sep 7, 2024

I like the @on decorator. I'd love to see an @action decorator so a:

Binding("x", "exit", "Exit")

Would be able to call:

@action("exit")
def exit_application(self) -> None:
    ...

Of course, note that the Binding action is "exit" which is given to the decorator, but the function name can be different.

I attempted to make this, reviewing some of the internal textual source code working with actions, but didn't get textualize to successfully call one of them.

Even if it's not something Textual wants to include, if anyone can make it I'd still be happy with that!

Copy link

github-actions bot commented Sep 7, 2024

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@Textualize Textualize locked and limited conversation to collaborators Sep 8, 2024
@darrenburns darrenburns converted this issue into discussion #4976 Sep 8, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant