py_projects/terminalUi/local.textual.py
AlexVeeBee a5106b4c14 Commit
2024-01-22 12:57:10 +00:00

30 lines
686 B
Python

from textual.app import App, ComposeResult
from textual.containers import ScrollableContainer
from textual.widgets import Header, Footer, Button, Static, DirectoryTree
class ProjectItem(Static):
def compose(self) -> ComposeResult:
yield Button("HHHH", id="project_name")
yield DirectoryTree("./")
class MyApp(App):
CSS_PATH = "app.tcss"
BINDINGS = [
("d", "toggle_dark", "Toggle dark mode")
]
def compose(self) -> ComposeResult:
yield Footer()
yield Header()
yield ProjectItem()
def action_toggle_dark(self):
self.dark = not self.dark
# --
if __name__ == "__main__":
app = MyApp()
app.run()