-
I want a 3x3 grid with a center widget that is wider than the neighbour widgets (no row-span!). All widgets are TextLog, except for the center widget, that consists of a top TextLog, and bottom Input, the latter with height 1. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Something like this? from textual.app import App, ComposeResult
from textual.containers import Horizontal, Vertical
from textual.widgets import Header, Footer, TextLog, Input
class NotAGridLayout( App[ None ] ):
CSS = """
.left, .middle, .right {
border: round #777;
}
.left, .right {
width: 1fr;
}
.middle {
width: 2fr;
}
TextLog {
height: 1fr;
}
"""
def compose( self ) -> ComposeResult:
yield Header()
yield Vertical(
Horizontal( TextLog( classes="left" ), TextLog( classes="middle" ), TextLog( classes="right" ) ),
Horizontal(
TextLog( classes="left" ),
Vertical( TextLog(), Input( placeholder="Here's the Input" ), classes="middle" ),
TextLog( classes="right" )
),
Horizontal( TextLog( classes="left" ), TextLog( classes="middle" ), TextLog( classes="right" ) ),
)
yield Footer()
if __name__ == "__main__":
NotAGridLayout().run() |
Beta Was this translation helpful? Give feedback.
Something like this?