+> (yield) operator and nice debug output!

This commit is contained in:
Xander Mckay 2024-11-26 15:37:08 -05:00
parent 440bd2f153
commit 0ebe183cfe
4 changed files with 55 additions and 9 deletions

25
examples/mini.it Normal file
View file

@ -0,0 +1,25 @@
from textual.app import App, ComposeResult
from textual.widgets import Header, Footer, TextArea
class Mini(App):
"""A Textual app to manage stopwatches."""
BINDINGS = [("ctrl+o", "open", "Open"), ("ctrl+s", "save", "Save"), ("ctrl+alt+s", "save_as", "Save as")]
def compose(self) -> ComposeResult:
"""Create child widgets for the app."""
+> Header()
+> TextArea()
+> Footer()
def action_save(self) -> None:
"""An action to save."""
pass
def action_open(self) -> None: pass
def action_save_as(self) -> None: pass
if __name__ == "__main__":
app = Mini()
app.run()