Skip to content
Discussion options

You must be logged in to vote

Do you think you could post a minimal working example of code that shows the issue you're seeing? I just tested with this:

from textual.app     import App, ComposeResult
from textual.widgets import Header, Footer, Checkbox

class CBKeyToggleApp( App[ None ] ):

    CSS = """
    Screen {
        align: center middle;
    }
    """

    def compose( self ) -> ComposeResult:
        yield Header()
        yield Checkbox("This is a test Checkbox", id="toggle-me")
        yield Footer()

    def on_key(self) -> None:
        self.query_one("#toggle-me", Checkbox).toggle()

if __name__ == "__main__":
    CBKeyToggleApp().run()

and it toggles the Checkbox just fine on any key.

Could you also po…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@msempere
Comment options

@davep
Comment options

Answer selected by msempere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants