mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
@@ -43,6 +43,6 @@ class ColorApp(App):
|
||||
self.screen.styles.animate("background", message.color, duration=0.5)
|
||||
|
||||
|
||||
app = ColorApp()
|
||||
if __name__ == "__main__":
|
||||
app = ColorApp()
|
||||
app.run()
|
||||
|
||||
@@ -15,6 +15,8 @@ from textual.widgets import Static, TextInput
|
||||
class DictionaryApp(App):
|
||||
"""Searches ab dictionary API as-you-type."""
|
||||
|
||||
CSS_PATH = "dictionary.css"
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield TextInput(placeholder="Search for a word")
|
||||
yield Vertical(Static(id="results", fluid=False), id="results-container")
|
||||
@@ -38,6 +40,6 @@ class DictionaryApp(App):
|
||||
self.query_one("#results", Static).update(JSON(results))
|
||||
|
||||
|
||||
app = DictionaryApp(css_path="dictionary.css")
|
||||
if __name__ == "__main__":
|
||||
app = DictionaryApp()
|
||||
app.run()
|
||||
|
||||
Reference in New Issue
Block a user