textual/docs/examples/styles/border_title_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
583 B
Python

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