added directory tree

This commit is contained in:
Will McGugan
2022-11-19 11:57:25 +00:00
parent 41e4d0328b
commit e2f6e2f82d
3 changed files with 181 additions and 102 deletions

View File

@@ -1,7 +1,7 @@
import json
from textual.app import App, ComposeResult
from textual.widgets import Header, Footer, Tree
from textual.widgets import Header, Footer, Tree, DirectoryTree
with open("food.json") as data_file:
@@ -23,7 +23,7 @@ class TreeApp(App):
def compose(self) -> ComposeResult:
yield Header()
yield Footer()
yield Tree("Root")
yield DirectoryTree("../")
def action_add(self) -> None:
tree = self.query_one(Tree)