text log widget

This commit is contained in:
Will McGugan
2022-09-16 16:14:28 +01:00
parent dfdb20d66e
commit bf90f7032d
9 changed files with 304 additions and 55 deletions

View File

@@ -0,0 +1,27 @@
from textual.app import App, ComposeResult
from textual.widgets import Static, TextLog
class BubbleApp(App):
CSS = """
"""
def compose(self) -> ComposeResult:
Static("Foo", id="static")
yield TextLog()
def on_key(self) -> None:
log = self.query_one(TextLog)
self.query_one(TextLog).write(self.tree)
log.write(repr((log.size, log.virtual_size)))
app = BubbleApp()
if __name__ == "__main__":
app.run()