code:
โจ```py
from textual.app import App
from textual.widgets import *
class SunDisk(App):
CSS = """
Label {
margin:1 1;
width: 100%;
height: 100%;
background: $panel;
border: tall $secondary;
content-align: center middle;
text-align: center;
}
"""
BINDINGS = [
("e", "exit", "Exit from the program."),
("c", "close", "Close a specific window from the tab menu."),
]
def on_mount(self):
self.theme = "gruvbox"
def compose(self):
yield Header(True, name="SunDisk Utility")
yield Tabs(
Tab("Welcome to SunDisk Utility", id="Welcome"),
Tab("Disk Statistics", id="dstat"),
Tab("File Explorer", id="fexpl"),
Tab("Partition Manager (Admin req.)", id="pmanager"),
)
yield Label()
yield Footer()
def on_tabs_tab_activated(self, event: Tabs.TabActivated):
label = self.query_one(Label)
if event.tab.id == "Welcome":
label.update(
"[bold]Welcome to SunDisk![/bold] \n SunDisk is a disk utility to provide easy access to disk utilities such as a file explorer and partition manager."
)
I've made this class for my app, and I want to keep my event activated code, but I want to change it so that the layout of each tab is different rather than just having the same layout with each tab (which is what this code does) (it's also unfinished, but I want to ask for future purposes)