From dfdb20d66e71435052ff6a00b661a04126ea0b09 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Thu, 15 Sep 2022 21:56:57 +0100 Subject: [PATCH] reference --- docs/guide/events.md | 2 +- mkdocs.yml | 7 +++++-- src/textual/events.py | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/guide/events.md b/docs/guide/events.md index 433654354..53603112c 100644 --- a/docs/guide/events.md +++ b/docs/guide/events.md @@ -14,7 +14,7 @@ Event classes (as used in event handlers) extend the [Event][textual.events.Even Every Textual app and widget contains a *message queue*. You can think of a message queue as orders at a restaurant. The chef takes an order and makes the dish. Orders that arrive while the chef is cooking are placed in a line. When the chef has finished a dish they pick up the first order that was added. -Textual processes messages in the same way. Messages are picked off the message queue and processed by a handler method. This guarantees messages and events are processed even if your code can not handle them right way. +Textual processes messages in the same way. Messages are picked off the message queue and processed (cooked) by a handler method. This guarantees messages and events are processed even if your code can not handle them right way. This processing of messages is done within an asyncio Task which is started when you mount the widget. The task monitors an asyncio queue for new messages. When a message arrives, the task dispatches it to the appropriate handler method. Once all messages have been processed the task goes back to waiting for messages. diff --git a/mkdocs.yml b/mkdocs.yml index a2c957d2f..88ac6cbed 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -88,16 +88,19 @@ nav: - "widgets/text_input.md" - "widgets/tree_control.md" - Reference: - - "reference/index.md" - "reference/app.md" - "reference/button.md" - "reference/color.md" - "reference/dom_node.md" - "reference/events.md" - "reference/geometry.md" + - "reference/index.md" - "reference/message_pump.md" - - "reference/timer.md" + - "reference/message.md" - "reference/query.md" + - "reference/reactive.md" + - "reference/screen.md" + - "reference/timer.md" - "reference/widget.md" diff --git a/src/textual/events.py b/src/textual/events.py index d58c9c649..fd79cf216 100644 --- a/src/textual/events.py +++ b/src/textual/events.py @@ -20,6 +20,8 @@ if TYPE_CHECKING: @rich.repr.auto class Event(Message): + """The base class for all events.""" + def __rich_repr__(self) -> rich.repr.Result: return yield