mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
25 lines
463 B
Python
25 lines
463 B
Python
from textual.app import App, ComposeResult
|
|
from textual.screen import Screen
|
|
from textual.widgets import Footer
|
|
|
|
|
|
class DefaultScreen(Screen):
|
|
|
|
BINDINGS = [("f", "foo", "FOO")]
|
|
|
|
def compose(self) -> ComposeResult:
|
|
yield Footer()
|
|
|
|
def action_foo(self) -> None:
|
|
self.app.bell()
|
|
|
|
|
|
class ScreenApp(App):
|
|
def on_mount(self) -> None:
|
|
self.push_screen(DefaultScreen())
|
|
|
|
|
|
app = ScreenApp()
|
|
if __name__ == "__main__":
|
|
app.run()
|