-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtui.py
More file actions
33 lines (24 loc) · 990 Bytes
/
Copy pathtui.py
File metadata and controls
33 lines (24 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from textual.app import App
from textual import events
from textual.views import GridView
from textual.reactive import Reactive
from textual.layouts.dock import DockLayout
from textual.widget import Widget
from textual.widgets import Header, Footer, Placeholder
class ConsoleInterface(Widget):
display = Reactive("0")
async def on_mount(self, event: events.Mount) -> None:
pass
class MainInterface(App):
async def on_mount(self):
# await self.view.dock(ConsoleInterface())
await self.view.dock(Header(), edge="top")
await self.view.dock(Footer(), edge="bottom")
await self.view.dock(Placeholder(), edge="left", size=30, name="sidebar")
await self.view.dock(Placeholder(), edge="left", size=30, name="rightbar")
async def on_load(self):
await self.bind("q", "quit")
async def on_key(self, event: events.Key) -> None:
print(event)
# self.console.print(event)
MainInterface.run()