Skip to content
Discussion options

You must be logged in to vote

I think you have a parenthesis in the wrong place. Here's your code reformatted a little:

from textual.app import App, ComposeResult
from textual.containers import Container, Horizontal
from textual.widgets import Static
from rich.text import Text


class WithWidth(Static):
    DEFAULT_CSS = """
        WithWidth {
            width: 3;
        }
        """


class MyApp(App):
    def compose(self) -> ComposeResult:
        yield Container(
            Horizontal(WithWidth("foo"), Static("bar")),
            Static("baz"),
        )

Inside your container you have a horizontal (which takes up the full screen), followed by a Static, which accounts for your extra line.

Suspect you meant som…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by MatrixManAtYrService
Comment options

You must be logged in to vote
0 replies
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