textual/docs/examples/styles/border_subtitle_align.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
610 B
Python

from textual.app import App
from textual.widgets import Label
class BorderSubtitleAlignApp(App):
CSS_PATH = "border_subtitle_align.tcss"
def compose(self):
lbl = Label("My subtitle is on the left.", id="label1")
lbl.border_subtitle = "< Left"
yield lbl
lbl = Label("My subtitle is centered", id="label2")
lbl.border_subtitle = "Centered!"
yield lbl
lbl = Label("My subtitle is on the right", id="label3")
lbl.border_subtitle = "Right >"
yield lbl
if __name__ == "__main__":
app = BorderSubtitleAlignApp()
app.run()