changed to CSS_PATH

This commit is contained in:
Will McGugan
2022-09-18 22:02:08 +01:00
parent f2c5e6ce78
commit d0293c2c89
80 changed files with 261 additions and 741 deletions

View File

@@ -25,6 +25,6 @@ class EventApp(App):
self.screen.styles.background = self.COLORS[int(event.key)]
app = EventApp()
if __name__ == "__main__":
app = EventApp()
app.run()

View File

@@ -12,7 +12,7 @@ class QuestionApp(App[str]):
self.exit(event.button.id)
app = QuestionApp()
if __name__ == "__main__":
app = QuestionApp()
reply = app.run()
print(reply)

View File

@@ -3,6 +3,8 @@ from textual.widgets import Static, Button
class QuestionApp(App[str]):
CSS_PATH = "question02.css"
def compose(self) -> ComposeResult:
yield Static("Do you love Textual?", id="question")
yield Button("Yes", id="yes", variant="primary")
@@ -12,7 +14,7 @@ class QuestionApp(App[str]):
self.exit(event.button.id)
app = QuestionApp(css_path="question02.css")
if __name__ == "__main__":
app = QuestionApp()
reply = app.run()
print(reply)

View File

@@ -32,7 +32,7 @@ class QuestionApp(App[str]):
self.exit(event.button.id)
app = QuestionApp()
if __name__ == "__main__":
app = QuestionApp()
reply = app.run()
print(reply)

View File

@@ -9,6 +9,6 @@ class ButtonsApp(App):
yield Button("Chani")
app = ButtonsApp()
if __name__ == "__main__":
app = ButtonsApp()
app.run()

View File

@@ -5,6 +5,6 @@ class MyApp(App):
pass
app = MyApp()
if __name__ == "__main__":
app = MyApp()
app.run()

View File

@@ -10,6 +10,6 @@ class WelcomeApp(App):
self.exit()
app = WelcomeApp()
if __name__ == "__main__":
app = WelcomeApp()
app.run()

View File

@@ -10,6 +10,6 @@ class WelcomeApp(App):
self.exit()
app = WelcomeApp()
if __name__ == "__main__":
app = WelcomeApp()
app.run()