About TabbedContent layout #4029
Answered
by
davep
Yurii-huang
asked this question in
Q&A
-
|
Why TabPane is not shown? from typing import Type
from textual._path import CSSPathType
from textual.app import CSSPathType, ComposeResult,App
from textual.driver import Driver
from textual.widgets import TabbedContent, TabPane, Markdown, ListView
LETO = """
# Duke Leto I Atreides
Head of House Atreides.
"""
JESSICA = """
# Lady Jessica
Bene Gesserit and concubine of Leto, and mother of Paul and Alia.
"""
PAUL = """
# Paul Atreides
Son of Leto and Jessica.
"""
class Network(TabbedContent):
def __init__(self):
super().__init__(id="Network")
def compose(self) -> ComposeResult:
with TabPane("LETO"):
yield Markdown(LETO)
with TabPane("JESSICA"):
yield Markdown(JESSICA)
with TabPane("PAUL"):
yield Markdown(PAUL)
class myApp(App):
def compose(self) -> ComposeResult:
yield Network()
if __name__ == "__main__":
app = myApp()
app.run() |
Beta Was this translation helpful? Give feedback.
Answered by
davep
Jan 16, 2024
Replies: 1 comment 3 replies
-
|
You are inheriting from |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

To start with, you could do what you're trying to do like this: