From 86a7bef71f1af49123c83eaca4da93c6cdc536a5 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Mon, 3 Oct 2022 17:38:10 +0100 Subject: [PATCH] replace references to TextInput --- docs/examples/events/dictionary.css | 12 +++--------- docs/guide/events.md | 4 ++-- docs/widgets/text_input.md | 1 - mkdocs.yml | 6 +++--- 4 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 docs/widgets/text_input.md diff --git a/docs/examples/events/dictionary.css b/docs/examples/events/dictionary.css index f0e46faa7..9b5e489ad 100644 --- a/docs/examples/events/dictionary.css +++ b/docs/examples/events/dictionary.css @@ -2,18 +2,12 @@ Screen { background: $panel; } -TextInput { - dock: top; - border: tall $background; +Input { + dock: top; width: 100%; height: 1; padding: 0 1; - margin: 1 1 0 1; - background: $boost; -} - -TextInput:focus { - border: tall $accent; + margin: 1 1 0 1; } #results { diff --git a/docs/guide/events.md b/docs/guide/events.md index 242c34cfd..d5fb2fe69 100644 --- a/docs/guide/events.md +++ b/docs/guide/events.md @@ -20,9 +20,9 @@ This processing of messages is done within an asyncio Task which is started when The FastAPI docs have an [excellent introduction](https://fastapi.tiangolo.com/async/) to Python async programming. -By way of an example, let's consider what happens if you were to type "Text" in to a `TextInput` widget. When you hit the ++t++ key, Textual creates a [key][textual.events.Key] event and sends it to the widget's message queue. Ditto for ++e++, ++x++, and ++t++. +By way of an example, let's consider what happens if you were to type "Text" in to a `Input` widget. When you hit the ++t++ key, Textual creates a [key][textual.events.Key] event and sends it to the widget's message queue. Ditto for ++e++, ++x++, and ++t++. -The widget's task will pick the first message from the queue (a key event for the ++t++ key) and call the `on_key` method with the event as the first argument. In other words it will call `TextInput.on_key(event)`, which updates the display to show the new letter. +The widget's task will pick the first message from the queue (a key event for the ++t++ key) and call the `on_key` method with the event as the first argument. In other words it will call `Input.on_key(event)`, which updates the display to show the new letter.
--8<-- "docs/images/events/queue.excalidraw.svg" diff --git a/docs/widgets/text_input.md b/docs/widgets/text_input.md deleted file mode 100644 index c55ce3dde..000000000 --- a/docs/widgets/text_input.md +++ /dev/null @@ -1 +0,0 @@ -# TextInput diff --git a/mkdocs.yml b/mkdocs.yml index 1d609b587..61470e8fd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -86,13 +86,13 @@ nav: - "styles/visibility.md" - "styles/width.md" - Widgets: - - "widgets/index.md" - "widgets/button.md" - "widgets/data_table.md" - "widgets/footer.md" - "widgets/header.md" + - "widgets/index.md" + - "widgets/input.md" - "widgets/static.md" - - "widgets/text_input.md" - "widgets/tree_control.md" - Reference: - "reference/app.md" @@ -162,7 +162,7 @@ theme: accent: purple toggle: icon: material/weather-sunny - name: Switch to dark mode + name: Switch to dark modeTask was destroyed but it is pending! - media: "(prefers-color-scheme: dark)" scheme: slate primary: black