textual/docs/examples/styles/align_all.py
Dave Pearson 414096233b
Make all styles reference examples capable of being run standalone
Also move the declarations of the stylesheets into the app classes.

See #3650
2023-11-08 14:37:01 +00:00

24 lines
894 B
Python

from textual.app import App, ComposeResult
from textual.containers import Container
from textual.widgets import Label
class AlignAllApp(App):
"""App that illustrates all alignments."""
CSS_PATH = "align_all.tcss"
def compose(self) -> ComposeResult:
yield Container(Label("left top"), id="left-top")
yield Container(Label("center top"), id="center-top")
yield Container(Label("right top"), id="right-top")
yield Container(Label("left middle"), id="left-middle")
yield Container(Label("center middle"), id="center-middle")
yield Container(Label("right middle"), id="right-middle")
yield Container(Label("left bottom"), id="left-bottom")
yield Container(Label("center bottom"), id="center-bottom")
yield Container(Label("right bottom"), id="right-bottom")
if __name__ == "__main__":
AlignAllApp().run()