mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
* words * how to * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> --------- Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
49 lines
871 B
Python
49 lines
871 B
Python
from textual.app import App, ComposeResult
|
|
from textual.screen import Screen
|
|
from textual.widgets import Placeholder
|
|
|
|
|
|
class Header(Placeholder):
|
|
DEFAULT_CSS = """
|
|
Header {
|
|
height: 3;
|
|
dock: top;
|
|
}
|
|
"""
|
|
|
|
|
|
class Footer(Placeholder):
|
|
DEFAULT_CSS = """
|
|
Footer {
|
|
height: 3;
|
|
dock: bottom;
|
|
}
|
|
"""
|
|
|
|
|
|
class ColumnsContainer(Placeholder):
|
|
DEFAULT_CSS = """
|
|
ColumnsContainer {
|
|
width: 1fr;
|
|
height: 1fr;
|
|
border: solid white;
|
|
}
|
|
""" # (1)!
|
|
|
|
|
|
class TweetScreen(Screen):
|
|
def compose(self) -> ComposeResult:
|
|
yield Header(id="Header")
|
|
yield Footer(id="Footer")
|
|
yield ColumnsContainer(id="Columns")
|
|
|
|
|
|
class LayoutApp(App):
|
|
def on_ready(self) -> None:
|
|
self.push_screen(TweetScreen())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app = LayoutApp()
|
|
app.run()
|