mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
more general app
This commit is contained in:
@@ -91,7 +91,7 @@ class Success(Widget):
|
||||
return Text("This is a success message", justify="center")
|
||||
|
||||
|
||||
class BasicApp(App):
|
||||
class BasicApp(App, css_path="basic.css"):
|
||||
"""A basic app demonstrating CSS"""
|
||||
|
||||
def on_load(self):
|
||||
@@ -158,7 +158,7 @@ class BasicApp(App):
|
||||
tweet_body.refresh(layout=True)
|
||||
|
||||
|
||||
app = BasicApp(css_path="basic.css")
|
||||
app = BasicApp()
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
|
||||
@@ -16,7 +16,7 @@ class TextWidget(Widget):
|
||||
return TEXT
|
||||
|
||||
|
||||
class AutoApp(App):
|
||||
class AutoApp(App, css_path="nest.css"):
|
||||
def on_mount(self) -> None:
|
||||
self.bind("t", "tree")
|
||||
|
||||
@@ -30,9 +30,3 @@ class AutoApp(App):
|
||||
|
||||
def action_tree(self):
|
||||
self.log(self.screen.tree)
|
||||
|
||||
|
||||
app = AutoApp(css_path="nest.css")
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
|
||||
Reference in New Issue
Block a user