mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Events
This commit is contained in:
9
docs/events/blur.md
Normal file
9
docs/events/blur.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Blur
|
||||
|
||||
The `Blur` event is sent to a widget when it loses focus.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
9
docs/events/descendant_blur.md
Normal file
9
docs/events/descendant_blur.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# DescendantBlur
|
||||
|
||||
The `DescendantBlur` event is sent to a widget when one of its children loses focus.
|
||||
|
||||
- [x] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
9
docs/events/descendant_focus.md
Normal file
9
docs/events/descendant_focus.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# DescendantFocus
|
||||
|
||||
The `DescendantFocus` event is sent to a widget when one of its children receives input focus.
|
||||
|
||||
- [x] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
9
docs/events/enter.md
Normal file
9
docs/events/enter.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Enter
|
||||
|
||||
The `Enter` event is sent to a widget when the mouse pointer first moves over a widget.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
9
docs/events/focus.md
Normal file
9
docs/events/focus.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Focus
|
||||
|
||||
The `Focus` event is sent to a widget when it receives input focus.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
9
docs/events/hide.md
Normal file
9
docs/events/hide.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Show
|
||||
|
||||
The `Hide` event is sent to a widget when it is hidden from view.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
_No additional attributes_
|
||||
11
docs/events/key.md
Normal file
11
docs/events/key.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Key
|
||||
|
||||
The `Key` event is sent to a widget when the user presses key on the keyboard.
|
||||
|
||||
- [x] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| --------- | ---- | ------------------------ |
|
||||
| `key` | str | The key that was pressed |
|
||||
9
docs/events/leave.md
Normal file
9
docs/events/leave.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Leave
|
||||
|
||||
The `Leave` event is sent to a widget when the mouse pointer moves off a widget.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
11
docs/events/load.md
Normal file
11
docs/events/load.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Mount
|
||||
|
||||
The `Load` event is sent to the app prior to switching the terminal in to application mode.
|
||||
|
||||
The load event is typically used to do any setup actions required by the app, that don't change the display.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
_No additional attributes_
|
||||
@@ -6,12 +6,6 @@ The mount event is typically used to set the initial state of a widget or to add
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Parameters
|
||||
## Attributes
|
||||
|
||||
`sender`
|
||||
|
||||
: The sender of the widget
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Mount
|
||||
_No additional attributes_
|
||||
|
||||
11
docs/events/mouse_capture.md
Normal file
11
docs/events/mouse_capture.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# MouseCapture
|
||||
|
||||
The `MouseCapture` event is sent to a widget when it is capturing mouse events from outside of its borders on the screen.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| ---------------- | ------ | --------------------------------------------- |
|
||||
| `mouse_position` | Offset | Mouse coordinates when the mouse was captured |
|
||||
20
docs/events/mouse_click.md
Normal file
20
docs/events/mouse_click.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Click
|
||||
|
||||
The `Click` event is sent to a widget when the user clicks a mouse button.
|
||||
|
||||
- [x] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| ---------- | ---- | ----------------------------------------- |
|
||||
| `x` | int | Mouse x coordinate, relative to Widget |
|
||||
| `y` | int | Mouse y coordinate, relative to Widget |
|
||||
| `delta_x` | int | Change in x since last mouse event |
|
||||
| `delta_y` | int | Change in x since last mouse event |
|
||||
| `button` | int | Index of mouse button |
|
||||
| `shift` | bool | Shift key pressed if True |
|
||||
| `meta` | bool | Meta key pressed if True |
|
||||
| `ctrl` | bool | Shift key pressed if True |
|
||||
| `screen_x` | int | Mouse x coordinate relative to the screen |
|
||||
| `screen_y` | int | Mouse y coordinate relative to the screen |
|
||||
20
docs/events/mouse_down.md
Normal file
20
docs/events/mouse_down.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# MouseDown
|
||||
|
||||
The `MouseDown` event is sent to a widget when a mouse button is pressed.
|
||||
|
||||
- [x] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| ---------- | ---- | ----------------------------------------- |
|
||||
| `x` | int | Mouse x coordinate, relative to Widget |
|
||||
| `y` | int | Mouse y coordinate, relative to Widget |
|
||||
| `delta_x` | int | Change in x since last mouse event |
|
||||
| `delta_y` | int | Change in x since last mouse event |
|
||||
| `button` | int | Index of mouse button |
|
||||
| `shift` | bool | Shift key pressed if True |
|
||||
| `meta` | bool | Meta key pressed if True |
|
||||
| `ctrl` | bool | Shift key pressed if True |
|
||||
| `screen_x` | int | Mouse x coordinate relative to the screen |
|
||||
| `screen_y` | int | Mouse y coordinate relative to the screen |
|
||||
20
docs/events/mouse_move.md
Normal file
20
docs/events/mouse_move.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# MouseMove
|
||||
|
||||
The `MouseMove` event is sent to a widget when the mouse pointer is moved over a widget.
|
||||
|
||||
- [x] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| ---------- | ---- | ----------------------------------------- |
|
||||
| `x` | int | Mouse x coordinate, relative to Widget |
|
||||
| `y` | int | Mouse y coordinate, relative to Widget |
|
||||
| `delta_x` | int | Change in x since last mouse event |
|
||||
| `delta_y` | int | Change in x since last mouse event |
|
||||
| `button` | int | Index of mouse button |
|
||||
| `shift` | bool | Shift key pressed if True |
|
||||
| `meta` | bool | Meta key pressed if True |
|
||||
| `ctrl` | bool | Shift key pressed if True |
|
||||
| `screen_x` | int | Mouse x coordinate relative to the screen |
|
||||
| `screen_y` | int | Mouse y coordinate relative to the screen |
|
||||
11
docs/events/mouse_release.md
Normal file
11
docs/events/mouse_release.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# MouseRelease
|
||||
|
||||
The `MouseRelease` event is sent to a widget it is no longer receiving mouse events outside of its borders.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| ---------------- | ------ | -------------------------------------------- |
|
||||
| `mouse_position` | Offset | Mouse coordinates when the mouse was release |
|
||||
12
docs/events/mouse_scroll_down.md
Normal file
12
docs/events/mouse_scroll_down.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# MouseScrollDown
|
||||
|
||||
The `MouseScrollDown` event is sent to a widget when scroll wheel (or trackpad equivalent) is moved _down_.
|
||||
|
||||
- [x] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| --------- | ---- | -------------------------------------- |
|
||||
| `x` | int | Mouse x coordinate, relative to Widget |
|
||||
| `y` | int | Mouse y coordinate, relative to Widget |
|
||||
12
docs/events/mouse_scroll_up.md
Normal file
12
docs/events/mouse_scroll_up.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# MouseScrollUp
|
||||
|
||||
The `MouseScrollUp` event is sent to a widget when scroll wheel (or trackpad equivalent) is moved _up_.
|
||||
|
||||
- [x] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| --------- | ---- | -------------------------------------- |
|
||||
| `x` | int | Mouse x coordinate, relative to Widget |
|
||||
| `y` | int | Mouse y coordinate, relative to Widget |
|
||||
20
docs/events/mouse_up.md
Normal file
20
docs/events/mouse_up.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# MouseUp
|
||||
|
||||
The `MouseUp` event is sent to a widget when the user releases a mouse button.
|
||||
|
||||
- [x] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| ---------- | ---- | ----------------------------------------- |
|
||||
| `x` | int | Mouse x coordinate, relative to Widget |
|
||||
| `y` | int | Mouse y coordinate, relative to Widget |
|
||||
| `delta_x` | int | Change in x since last mouse event |
|
||||
| `delta_y` | int | Change in x since last mouse event |
|
||||
| `button` | int | Index of mouse button |
|
||||
| `shift` | bool | Shift key pressed if True |
|
||||
| `meta` | bool | Meta key pressed if True |
|
||||
| `ctrl` | bool | Shift key pressed if True |
|
||||
| `screen_x` | int | Mouse x coordinate relative to the screen |
|
||||
| `screen_y` | int | Mouse y coordinate relative to the screen |
|
||||
11
docs/events/paste.md
Normal file
11
docs/events/paste.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Paste
|
||||
|
||||
The `Paste` event is sent to a widget when the user pastes text.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| --------- | ---- | ------------------------ |
|
||||
| `text` | str | The text that was pasted |
|
||||
@@ -4,20 +4,10 @@ The `Resize` event is sent to a widget when its size changes and when it is firs
|
||||
|
||||
- [x] Bubbles
|
||||
|
||||
## Parameters
|
||||
## Attributes
|
||||
|
||||
`event.size`
|
||||
|
||||
: The new size of the Widget.
|
||||
|
||||
`event.virtual_size`
|
||||
|
||||
: The virtual size (scrollable area) of the Widget.
|
||||
|
||||
`event.container_size`
|
||||
|
||||
: The size of the widget's container.
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Mount
|
||||
| attribute | type | purpose |
|
||||
| ---------------- | ---- | ------------------------------------------------- |
|
||||
| `size` | Size | The new size of the Widget. |
|
||||
| `virtual_size` | Size | The virtual size (scrollable area) of the Widget. |
|
||||
| `container_size` | Size | The size of the container (parent widget). |
|
||||
|
||||
9
docs/events/screen_resume.md
Normal file
9
docs/events/screen_resume.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# ScreenResume
|
||||
|
||||
The `ScreenResume` event is sent to a **Screen** when it becomes current.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
9
docs/events/screen_suspend.md
Normal file
9
docs/events/screen_suspend.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# ScreenSuspend
|
||||
|
||||
The `ScreenSuspend` event is sent to a **Screen** when it is replaced by another screen.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
9
docs/events/show.md
Normal file
9
docs/events/show.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Show
|
||||
|
||||
The `Show` event is sent to a widget when it becomes visible.
|
||||
|
||||
- [ ] Bubbles
|
||||
|
||||
## Attributes
|
||||
|
||||
_No additional attributes_
|
||||
Reference in New Issue
Block a user