Skip to content
Discussion options

You must be logged in to vote

I may be misunderstanding what you're trying to do, but I think if I was to approach a "add pane and split parent" effect I'd start out with this:

from textual.app import App, ComposeResult
from textual.widgets import Header, Footer
from textual.containers import Horizontal, Vertical

class Splitter( App[ None ] ):

    CSS = """
    Horizontal {
        border: solid #666;
    }

    Vertical {
        border: solid #888;
        width: 1fr;
    }
    """

    BINDINGS = [
        ( "n", "new_pane", "New Pane" )
    ]

    def compose(self) -> ComposeResult:
        yield Header()
        yield Horizontal( id="main" )
        yield Footer()

    def action_new_pane( self ) -> None:
        

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@pom11
Comment options

@davep
Comment options

@pom11
Comment options

Answer selected by davep
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