mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add all messages to widget references.
This commit is contained in:
@@ -39,15 +39,7 @@ Clicking any of the non-disabled buttons in the example app below will result th
|
|||||||
|
|
||||||
## Messages
|
## Messages
|
||||||
|
|
||||||
### Pressed
|
### ::: textual.widgets.Button.Pressed
|
||||||
|
|
||||||
The `Button.Pressed` message is sent when the button is pressed.
|
|
||||||
|
|
||||||
- [x] Bubbles
|
|
||||||
|
|
||||||
#### Attributes
|
|
||||||
|
|
||||||
_No other attributes_
|
|
||||||
|
|
||||||
## Additional Notes
|
## Additional Notes
|
||||||
|
|
||||||
|
|||||||
@@ -32,20 +32,6 @@ The example below shows checkboxes in various states.
|
|||||||
| ------- | ------ | ------- | ---------------------------------- |
|
| ------- | ------ | ------- | ---------------------------------- |
|
||||||
| `value` | `bool` | `False` | The default value of the checkbox. |
|
| `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
|
## Bindings
|
||||||
|
|
||||||
The checkbox widget defines directly the following 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_heading: false
|
||||||
show_root_toc_entry: false
|
show_root_toc_entry: false
|
||||||
|
|
||||||
|
## Messages
|
||||||
|
|
||||||
|
### ::: textual.widgets.Checkbox.Changed
|
||||||
|
|
||||||
## Additional Notes
|
## Additional Notes
|
||||||
|
|
||||||
- To remove the spacing around a checkbox, set `border: none;` and `padding: 0;`.
|
- To remove the spacing around a checkbox, set `border: none;` and `padding: 0;`.
|
||||||
|
|||||||
@@ -16,17 +16,7 @@ The example below creates a simple tree to navigate the current working director
|
|||||||
|
|
||||||
## Messages
|
## Messages
|
||||||
|
|
||||||
### FileSelected
|
### ::: textual.widgets.DirectoryTree.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. |
|
|
||||||
|
|
||||||
## Reactive Attributes
|
## Reactive Attributes
|
||||||
|
|
||||||
|
|||||||
@@ -32,30 +32,9 @@ The example below shows how you might create a simple form using two `Input` wid
|
|||||||
|
|
||||||
## Messages
|
## Messages
|
||||||
|
|
||||||
### Changed
|
### ::: textual.widgets.Input.Changed
|
||||||
|
|
||||||
The `Input.Changed` message is sent when the value in the text input changes.
|
### ::: textual.widgets.Input.Submitted
|
||||||
|
|
||||||
- [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. |
|
|
||||||
|
|
||||||
## Bindings
|
## Bindings
|
||||||
|
|
||||||
|
|||||||
@@ -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 |
|
| `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
|
#### Attributes
|
||||||
|
|
||||||
|
|||||||
@@ -35,33 +35,9 @@ The example below shows an app with a simple `ListView`.
|
|||||||
|
|
||||||
## Messages
|
## Messages
|
||||||
|
|
||||||
### Highlighted
|
### ::: textual.widgets.ListView.Highlighted
|
||||||
|
|
||||||
The `ListView.Highlighted` message is emitted when the highlight changes.
|
### ::: textual.widgets.ListView.Selected
|
||||||
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. |
|
|
||||||
|
|
||||||
## Bindings
|
## Bindings
|
||||||
|
|
||||||
|
|||||||
@@ -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. |
|
| `show_guides` | `bool` | `True` | Show guide lines between levels. |
|
||||||
| `guide_depth` | `int` | `4` | Amount of indentation between parent and child. |
|
| `guide_depth` | `int` | `4` | Amount of indentation between parent and child. |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Messages
|
## 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
|
### ::: textual.widgets.Tree.NodeSelected
|
||||||
|
|
||||||
| 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. |
|
|
||||||
|
|
||||||
## Bindings
|
## Bindings
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user