mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Replace Static with Label.
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
from textual.app import App, ComposeResult
|
from textual.app import App, ComposeResult
|
||||||
from textual.widgets import Static, Button
|
from textual.widgets import Label, Button
|
||||||
|
|
||||||
|
|
||||||
class QuestionApp(App[str]):
|
class QuestionApp(App[str]):
|
||||||
def compose(self) -> ComposeResult:
|
def compose(self) -> ComposeResult:
|
||||||
yield Static("Do you love Textual?")
|
yield Label("Do you love Textual?")
|
||||||
yield Button("Yes", id="yes", variant="primary")
|
yield Button("Yes", id="yes", variant="primary")
|
||||||
yield Button("No", id="no", variant="error")
|
yield Button("No", id="no", variant="error")
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
from textual.app import App, ComposeResult
|
from textual.app import App, ComposeResult
|
||||||
from textual.widgets import Static, Button
|
from textual.widgets import Label, Button
|
||||||
|
|
||||||
|
|
||||||
class QuestionApp(App[str]):
|
class QuestionApp(App[str]):
|
||||||
CSS_PATH = "question02.css"
|
CSS_PATH = "question02.css"
|
||||||
|
|
||||||
def compose(self) -> ComposeResult:
|
def compose(self) -> ComposeResult:
|
||||||
yield Static("Do you love Textual?", id="question")
|
yield Label("Do you love Textual?", id="question")
|
||||||
yield Button("Yes", id="yes", variant="primary")
|
yield Button("Yes", id="yes", variant="primary")
|
||||||
yield Button("No", id="no", variant="error")
|
yield Button("No", id="no", variant="error")
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from textual.app import App, ComposeResult
|
from textual.app import App, ComposeResult
|
||||||
from textual.widgets import Static, Button
|
from textual.widgets import Label, Button
|
||||||
|
|
||||||
|
|
||||||
class QuestionApp(App[str]):
|
class QuestionApp(App[str]):
|
||||||
@@ -24,7 +24,7 @@ class QuestionApp(App[str]):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def compose(self) -> ComposeResult:
|
def compose(self) -> ComposeResult:
|
||||||
yield Static("Do you love Textual?", id="question")
|
yield Label("Do you love Textual?", id="question")
|
||||||
yield Button("Yes", id="yes", variant="primary")
|
yield Button("Yes", id="yes", variant="primary")
|
||||||
yield Button("No", id="no", variant="error")
|
yield Button("No", id="no", variant="error")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user