Add all messages to widget references.

This commit is contained in:
Rodrigo Girão Serrão
2023-01-26 11:53:51 +00:00
parent fb4f804dff
commit b37517c400
7 changed files with 14 additions and 123 deletions

View File

@@ -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

View File

@@ -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;`.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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