code in events

This commit is contained in:
Will McGugan
2022-09-26 10:41:36 +01:00
parent 3f0955cbe5
commit 28d395f774
26 changed files with 126 additions and 17 deletions

View File

@@ -8,3 +8,7 @@ The `Blur` event is sent to a widget when it loses focus.
## Attributes
_No other attributes_
## Code
::: textual.events.Blur

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -8,3 +8,7 @@ The `ScreenResume` event is sent to a **Screen** when it becomes current.
## Attributes
_No other attributes_
## Code
::: textual.events.ScreenResume

View File

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

View File

@@ -8,3 +8,7 @@ The `Show` event is sent to a widget when it becomes visible.
## Attributes
_No additional attributes_
## Code
::: textual.events.Show