Skip to content
Discussion options

You must be logged in to vote

As you've discovered, grid is for fitting things within the display, essentially. I think if I was going to do what you're asking here, I'd start out with this sort of framework:

from textual.app import App, ComposeResult
from textual.containers import VerticalScroll, Horizontal
from textual.widgets import Static

class ScrollableGridApp(App[None]):

    CSS = """
    .row {
        height: 5;
    }

    .row Static {
        border: solid cornflowerblue;
        width: 1fr;
        height: 1fr;
    }
    """

    def compose(self) -> ComposeResult:
        with VerticalScroll():
            for y in range(20):
                with Horizontal(classes="row"):
                    for x in r…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@davep
Comment options

Answer selected by theredfoxlee
Comment options

You must be logged in to vote
1 reply
@davep
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants