debugging app refreshes

This commit is contained in:
Will McGugan
2022-05-25 17:16:31 +01:00
parent 43e9f8add9
commit 153567d3b1
6 changed files with 15 additions and 4 deletions

View File

@@ -3,6 +3,10 @@ from textual.app import App
class ExampleApp(App):
CSS = """
"""
COLORS = [
"white",
"maroon",
@@ -18,12 +22,15 @@ class ExampleApp(App):
def on_mount(self):
self.styles.background = "darkblue"
self.bind("t", "tree")
def on_key(self, event):
if event.key.isdigit():
self.styles.background = self.COLORS[int(event.key)]
self.bell()
def action_tree(self):
self.log(self.tree)
app = ExampleApp()
app.run()