From b37517c40054889ad7bd14a2272db2ddd0b414e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?= <5621605+rodrigogiraoserrao@users.noreply.github.com> Date: Thu, 26 Jan 2023 11:53:51 +0000 Subject: [PATCH] Add all messages to widget references. --- docs/widgets/button.md | 10 +-------- docs/widgets/checkbox.md | 18 ++++------------- docs/widgets/directory_tree.md | 12 +---------- docs/widgets/input.md | 25 ++--------------------- docs/widgets/list_item.md | 7 ------- docs/widgets/list_view.md | 28 ++----------------------- docs/widgets/tree.md | 37 ++++------------------------------ 7 files changed, 14 insertions(+), 123 deletions(-) diff --git a/docs/widgets/button.md b/docs/widgets/button.md index ff7436d3b..d5b07ec96 100644 --- a/docs/widgets/button.md +++ b/docs/widgets/button.md @@ -39,15 +39,7 @@ Clicking any of the non-disabled buttons in the example app below will result th ## Messages -### Pressed - -The `Button.Pressed` message is sent when the button is pressed. - -- [x] Bubbles - -#### Attributes - -_No other attributes_ +### ::: textual.widgets.Button.Pressed ## Additional Notes diff --git a/docs/widgets/checkbox.md b/docs/widgets/checkbox.md index a8ed28054..a5a247ef9 100644 --- a/docs/widgets/checkbox.md +++ b/docs/widgets/checkbox.md @@ -32,20 +32,6 @@ The example below shows checkboxes in various states. | ------- | ------ | ------- | ---------------------------------- | | `value` | `bool` | `False` | The default value of the checkbox. | -## Messages - -### Pressed - -The `Checkbox.Changed` message is sent when the checkbox is toggled. - -- [x] Bubbles - -#### Attributes - -| attribute | type | purpose | -| --------- | ------ | ------------------------------ | -| `value` | `bool` | The new value of the checkbox. | - ## Bindings The checkbox widget defines directly the following bindings: @@ -64,6 +50,10 @@ The checkbox widget provides the following component classes: show_root_heading: false show_root_toc_entry: false +## Messages + +### ::: textual.widgets.Checkbox.Changed + ## Additional Notes - To remove the spacing around a checkbox, set `border: none;` and `padding: 0;`. diff --git a/docs/widgets/directory_tree.md b/docs/widgets/directory_tree.md index 5af71d64f..a43ae5beb 100644 --- a/docs/widgets/directory_tree.md +++ b/docs/widgets/directory_tree.md @@ -16,17 +16,7 @@ The example below creates a simple tree to navigate the current working director ## Messages -### FileSelected - -The `DirectoryTree.FileSelected` message is sent when the user selects a file in the tree - -- [x] Bubbles - -#### Attributes - -| attribute | type | purpose | -| --------- | ----- | ----------------- | -| `path` | `str` | Path of the file. | +### ::: textual.widgets.DirectoryTree.FileSelected ## Reactive Attributes diff --git a/docs/widgets/input.md b/docs/widgets/input.md index c5a7cc724..ee6183cf8 100644 --- a/docs/widgets/input.md +++ b/docs/widgets/input.md @@ -32,30 +32,9 @@ The example below shows how you might create a simple form using two `Input` wid ## Messages -### Changed +### ::: textual.widgets.Input.Changed -The `Input.Changed` message is sent when the value in the text input changes. - -- [x] Bubbles - -#### Attributes - -| attribute | type | purpose | -| --------- | ----- | -------------------------------- | -| `value` | `str` | The new value in the text input. | - - -### Submitted - -The `Input.Submitted` message is sent when you press ++enter++ with the text field submitted. - -- [x] Bubbles - -#### Attributes - -| attribute | type | purpose | -| --------- | ----- | -------------------------------- | -| `value` | `str` | The new value in the text input. | +### ::: textual.widgets.Input.Submitted ## Bindings diff --git a/docs/widgets/list_item.md b/docs/widgets/list_item.md index 5a9ed4435..698214159 100644 --- a/docs/widgets/list_item.md +++ b/docs/widgets/list_item.md @@ -27,13 +27,6 @@ of multiple `ListItem`s. The arrow keys can be used to navigate the list. |---------------|--------|---------|--------------------------------------| | `highlighted` | `bool` | `False` | True if this ListItem is highlighted | -## Messages - -### Selected - -The `ListItem.Selected` message is sent when the item is selected. - - - [x] Bubbles #### Attributes diff --git a/docs/widgets/list_view.md b/docs/widgets/list_view.md index a348eedbd..8bca015df 100644 --- a/docs/widgets/list_view.md +++ b/docs/widgets/list_view.md @@ -35,33 +35,9 @@ The example below shows an app with a simple `ListView`. ## Messages -### Highlighted +### ::: textual.widgets.ListView.Highlighted -The `ListView.Highlighted` message is emitted when the highlight changes. -This happens when you use the arrow keys on your keyboard and when you -click on a list item. - -- [x] Bubbles - -#### Attributes - -| attribute | type | purpose | -| --------- | ---------- | ------------------------------ | -| `item` | `ListItem` | The item that was highlighted. | - -### Selected - -The `ListView.Selected` message is emitted when a list item is selected. -You can select a list item by pressing ++enter++ while it is highlighted, -or by clicking on it. - -- [x] Bubbles - -#### Attributes - -| attribute | type | purpose | -| --------- | ---------- | --------------------------- | -| `item` | `ListItem` | The item that was selected. | +### ::: textual.widgets.ListView.Selected ## Bindings diff --git a/docs/widgets/tree.md b/docs/widgets/tree.md index ce476bd16..d35a7648d 100644 --- a/docs/widgets/tree.md +++ b/docs/widgets/tree.md @@ -32,44 +32,15 @@ A each tree widget has a "root" attribute which is an instance of a [TreeNode][t | `show_guides` | `bool` | `True` | Show guide lines between levels. | | `guide_depth` | `int` | `4` | Amount of indentation between parent and child. | - - ## Messages -### NodeSelected +### ::: textual.widgets.Tree.NodeCollapsed -The `Tree.NodeSelected` message is sent when the user selects a tree node. +### ::: textual.widgets.Tree.NodeExpanded +### ::: textual.widgets.Tree.NodeHighlighted -#### Attributes - -| attribute | type | purpose | -| --------- | ------------------------------------ | -------------- | -| `node` | [TreeNode][textual.widgets.TreeNode] | Selected node. | - - -### NodeExpanded - -The `Tree.NodeExpanded` message is sent when the user expands a node in the tree. - -#### Attributes - -| attribute | type | purpose | -| --------- | ------------------------------------ | -------------- | -| `node` | [TreeNode][textual.widgets.TreeNode] | Expanded node. | - - -### NodeCollapsed - - -The `Tree.NodeCollapsed` message is sent when the user expands a node in the tree. - - -#### Attributes - -| attribute | type | purpose | -| --------- | ------------------------------------ | --------------- | -| `node` | [TreeNode][textual.widgets.TreeNode] | Collapsed node. | +### ::: textual.widgets.Tree.NodeSelected ## Bindings