mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
code in events
This commit is contained in:
@@ -8,3 +8,7 @@ The `Blur` event is sent to a widget when it loses focus.
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Blur
|
||||
|
||||
@@ -19,3 +19,7 @@ The `Click` event is sent to a widget when the user clicks a mouse button.
|
||||
| `ctrl` | bool | Ctrl key pressed if True |
|
||||
| `screen_x` | int | Mouse x coordinate relative to the screen |
|
||||
| `screen_y` | int | Mouse y coordinate relative to the screen |
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Click
|
||||
|
||||
@@ -8,3 +8,7 @@ The `DescendantBlur` event is sent to a widget when one of its children loses fo
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.DescendantBlur
|
||||
|
||||
@@ -8,3 +8,7 @@ The `DescendantFocus` event is sent to a widget when one of its descendants rece
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.DescendantFocus
|
||||
|
||||
@@ -8,3 +8,7 @@ The `Enter` event is sent to a widget when the mouse pointer first moves over a
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Enter
|
||||
|
||||
@@ -8,3 +8,7 @@ The `Focus` event is sent to a widget when it receives input focus.
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Focus
|
||||
|
||||
@@ -8,3 +8,7 @@ The `Hide` event is sent to a widget when it is hidden from view.
|
||||
## Attributes
|
||||
|
||||
_No additional attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Hide
|
||||
|
||||
@@ -11,3 +11,7 @@ The `Key` event is sent to a widget when the user presses a key on the keyboard.
|
||||
| --------- | ----------- | ----------------------------------------------------------- |
|
||||
| `key` | str | Name of the key that was pressed. |
|
||||
| `char` | str or None | The character that was pressed, or None it isn't printable. |
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Key
|
||||
|
||||
@@ -8,3 +8,7 @@ The `Leave` event is sent to a widget when the mouse pointer moves off a widget.
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Leave
|
||||
|
||||
@@ -10,3 +10,7 @@ The load event is typically used to do any setup actions required by the app tha
|
||||
## Attributes
|
||||
|
||||
_No additional attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Load
|
||||
|
||||
@@ -10,3 +10,7 @@ The mount event is typically used to set the initial state of a widget or to add
|
||||
## Attributes
|
||||
|
||||
_No additional attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Mount
|
||||
|
||||
@@ -10,3 +10,7 @@ The `MouseCapture` event is sent to a widget when it is capturing mouse events f
|
||||
| attribute | type | purpose |
|
||||
| ---------------- | ------ | --------------------------------------------- |
|
||||
| `mouse_position` | Offset | Mouse coordinates when the mouse was captured |
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.MouseCapture
|
||||
|
||||
@@ -19,3 +19,7 @@ The `MouseDown` event is sent to a widget when a mouse button is pressed.
|
||||
| `ctrl` | bool | Ctrl key pressed if True |
|
||||
| `screen_x` | int | Mouse x coordinate relative to the screen |
|
||||
| `screen_y` | int | Mouse y coordinate relative to the screen |
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.MouseDown
|
||||
|
||||
@@ -19,3 +19,7 @@ The `MouseMove` event is sent to a widget when the mouse pointer is moved over a
|
||||
| `ctrl` | bool | Ctrl key pressed if True |
|
||||
| `screen_x` | int | Mouse x coordinate relative to the screen |
|
||||
| `screen_y` | int | Mouse y coordinate relative to the screen |
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.MouseMove
|
||||
|
||||
@@ -7,6 +7,10 @@ The `MouseRelease` event is sent to a widget when it is no longer receiving mous
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| ---------------- | ------ | -------------------------------------------- |
|
||||
| attribute | type | purpose |
|
||||
| ---------------- | ------ | --------------------------------------------- |
|
||||
| `mouse_position` | Offset | Mouse coordinates when the mouse was released |
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.MouseRelease
|
||||
|
||||
@@ -8,6 +8,10 @@ The `MouseScrollDown` event is sent to a widget when the scroll wheel (or trackp
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
|-----------|------|----------------------------------------|
|
||||
| --------- | ---- | -------------------------------------- |
|
||||
| `x` | int | Mouse x coordinate, relative to Widget |
|
||||
| `y` | int | Mouse y coordinate, relative to Widget |
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.MouseScrollDown
|
||||
|
||||
@@ -11,3 +11,7 @@ The `MouseScrollUp` event is sent to a widget when the scroll wheel (or trackpad
|
||||
| --------- | ---- | -------------------------------------- |
|
||||
| `x` | int | Mouse x coordinate, relative to Widget |
|
||||
| `y` | int | Mouse y coordinate, relative to Widget |
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.MouseScrollUp
|
||||
|
||||
@@ -19,3 +19,7 @@ The `MouseUp` event is sent to a widget when the user releases a mouse button.
|
||||
| `ctrl` | bool | Ctrl key pressed if True |
|
||||
| `screen_x` | int | Mouse x coordinate relative to the screen |
|
||||
| `screen_y` | int | Mouse y coordinate relative to the screen |
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.MouseUp
|
||||
|
||||
@@ -10,3 +10,7 @@ The `Paste` event is sent to a widget when the user pastes text.
|
||||
| attribute | type | purpose |
|
||||
| --------- | ---- | ------------------------ |
|
||||
| `text` | str | The text that was pasted |
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Paste
|
||||
|
||||
@@ -7,8 +7,12 @@ The `Resize` event is sent to a widget when its size changes and when it is firs
|
||||
|
||||
## Attributes
|
||||
|
||||
| attribute | type | purpose |
|
||||
| ---------------- | ---- | ------------------------------------------------- |
|
||||
| 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) |
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Resize
|
||||
|
||||
@@ -8,3 +8,7 @@ The `ScreenResume` event is sent to a **Screen** when it becomes current.
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.ScreenResume
|
||||
|
||||
@@ -8,3 +8,7 @@ The `ScreenSuspend` event is sent to a **Screen** when it is replaced by another
|
||||
## Attributes
|
||||
|
||||
_No other attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.ScreenSuspend
|
||||
|
||||
@@ -8,3 +8,7 @@ The `Show` event is sent to a widget when it becomes visible.
|
||||
## Attributes
|
||||
|
||||
_No additional attributes_
|
||||
|
||||
## Code
|
||||
|
||||
::: textual.events.Show
|
||||
|
||||
Reference in New Issue
Block a user