Merge branch 'css' of github.com:willmcgugan/textual into text-justify

This commit is contained in:
Darren Burns
2022-08-26 12:28:23 +01:00
170 changed files with 4620 additions and 1354 deletions

View File

@@ -97,6 +97,7 @@ DataTable {
Tweet {
height:12;
width: 100%;
margin: 0 2;
margin:0 2;
background: $panel;
@@ -109,6 +110,7 @@ Tweet {
/* scrollbar-gutter: stable; */
align-horizontal: center;
box-sizing: border-box;
}

27
sandbox/will/order.py Normal file
View File

@@ -0,0 +1,27 @@
import asyncio
from textual.app import App
from textual import events
from textual.widget import Widget
class OrderWidget(Widget, can_focus=True):
def on_key(self, event) -> None:
self.log("PRESS", event.key)
class OrderApp(App):
def compose(self):
yield OrderWidget()
async def on_mount(self):
async def send_keys():
self.query_one(OrderWidget).focus()
chars = ["tab", "enter", "h", "e", "l", "l", "o"]
for char in chars:
self.log("SENDING", char)
await self.post_message(events.Key(self, key=char))
self.set_timer(1, lambda: asyncio.create_task(send_keys()))
app = OrderApp()