mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
changed to CSS_PATH
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -9,6 +9,6 @@ class ButtonsApp(App):
|
||||
yield Button("Chani")
|
||||
|
||||
|
||||
app = ButtonsApp()
|
||||
if __name__ == "__main__":
|
||||
app = ButtonsApp()
|
||||
app.run()
|
||||
|
||||
@@ -5,6 +5,6 @@ class MyApp(App):
|
||||
pass
|
||||
|
||||
|
||||
app = MyApp()
|
||||
if __name__ == "__main__":
|
||||
app = MyApp()
|
||||
app.run()
|
||||
|
||||
@@ -10,6 +10,6 @@ class WelcomeApp(App):
|
||||
self.exit()
|
||||
|
||||
|
||||
app = WelcomeApp()
|
||||
if __name__ == "__main__":
|
||||
app = WelcomeApp()
|
||||
app.run()
|
||||
|
||||
@@ -10,6 +10,6 @@ class WelcomeApp(App):
|
||||
self.exit()
|
||||
|
||||
|
||||
app = WelcomeApp()
|
||||
if __name__ == "__main__":
|
||||
app = WelcomeApp()
|
||||
app.run()
|
||||
|
||||
Reference in New Issue
Block a user