mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
29 lines
449 B
Python
29 lines
449 B
Python
from textual.app import App
|
|
from textual.widgets import Static
|
|
|
|
|
|
class CenterApp(App):
|
|
CSS = """
|
|
|
|
Screen {
|
|
layout: center;
|
|
overflow: auto auto;
|
|
}
|
|
|
|
Static {
|
|
border: wide $primary;
|
|
background: $panel;
|
|
width: 50;
|
|
height: 20;
|
|
margin: 1 2;
|
|
content-align: center middle;
|
|
}
|
|
|
|
"""
|
|
|
|
def compose(self):
|
|
yield Static("Hello World!")
|
|
|
|
|
|
app = CenterApp()
|