Replace Static with Label.

This commit is contained in:
Rodrigo Girão Serrão
2023-01-31 17:31:36 +00:00
parent c14f635244
commit 828d8d2cf1
3 changed files with 9 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
from textual.app import App, ComposeResult
from textual.widgets import Static, Button
from textual.widgets import Label, Button
class QuestionApp(App[str]):
@@ -7,8 +7,8 @@ class QuestionApp(App[str]):
Screen {
layout: grid;
grid-size: 2;
grid-gutter: 2;
padding: 2;
grid-gutter: 2;
padding: 2;
}
#question {
width: 100%;
@@ -16,7 +16,7 @@ class QuestionApp(App[str]):
column-span: 2;
content-align: center bottom;
text-style: bold;
}
}
Button {
width: 100%;
@@ -24,7 +24,7 @@ class QuestionApp(App[str]):
"""
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("No", id="no", variant="error")