more docs

This commit is contained in:
Will McGugan
2022-08-10 17:49:45 +01:00
parent a36b04619f
commit f7ff893de8
10 changed files with 122 additions and 11 deletions

View File

@@ -0,0 +1,30 @@
from datetime import datetime
from textual.app import App
from textual.widget import Widget
class Clock(Widget):
"""A clock app."""
CSS = """
Clock {
content-align: center middle;
}
"""
def on_mount(self):
self.set_interval(1, self.refresh)
def render(self):
return datetime.now().strftime("%c")
class ClockApp(App):
def compose(self):
yield Clock()
app = ClockApp()
if __name__ == "__main__":
app.run()