new layout

This commit is contained in:
Will McGugan
2022-04-28 13:17:10 +01:00
parent 44c1f2373a
commit 4090d35168
20 changed files with 189 additions and 116 deletions

24
sandbox/buttons.py Normal file
View File

@@ -0,0 +1,24 @@
from textual.app import App, ComposeResult
from textual.widgets import Button
from textual import layout
class ButtonsApp(App[str]):
def compose(self) -> ComposeResult:
yield layout.Vertical(
Button("foo", id="foo"),
Button("bar", id="bar"),
Button("baz", id="baz"),
)
def handle_pressed(self, event: Button.Pressed) -> None:
self.app.bell()
self.exit(event.button.id)
app = ButtonsApp(log="textual.log")
if __name__ == "__main__":
result = app.run()
print(repr(result))