Skip to content

Commit fc56863

Browse files
committed
event docstrings
1 parent f432a00 commit fc56863

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

docs/events/mouse_capture.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ title: MouseCapture
88

99
## See also
1010

11+
- [capture_mouse][textual.widget.Widget.capture_mouse]
12+
- [release_mouse][textual.widget.Widget.release_mouse]
1113
- [MouseRelease](mouse_release.md)

docs/events/mouse_release.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ title: MouseRelease
88

99
## See also
1010

11+
- [capture_mouse][textual.widget.Widget.capture_mouse]
12+
- [release_mouse][textual.widget.Widget.release_mouse]
1113
- [MouseCapture](mouse_capture.md)

src/textual/events.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Load(Event, bubble=False):
5959
"""
6060
Sent when the App is running but *before* the terminal is in application mode.
6161
62-
Use this event to run any set up that doesn't require any visuals such as loading
62+
Use this event to run any setup that doesn't require any visuals such as loading
6363
configuration and binding keys.
6464
6565
- [ ] Bubbles
@@ -129,6 +129,9 @@ def __rich_repr__(self) -> rich.repr.Result:
129129
class Compose(Event, bubble=False, verbose=True):
130130
"""Sent to a widget to request it to compose and mount children.
131131
132+
This event is used internally by Textual.
133+
You won't typically need to explicitly handle it,
134+
132135
- [ ] Bubbles
133136
- [X] Verbose
134137
"""
@@ -151,7 +154,7 @@ class Unmount(Event, bubble=False, verbose=False):
151154

152155

153156
class Show(Event, bubble=False):
154-
"""Sent when a widget has become visible.
157+
"""Sent when a widget is first displayed.
155158
156159
- [ ] Bubbles
157160
- [ ] Verbose
@@ -164,13 +167,17 @@ class Hide(Event, bubble=False):
164167
- [ ] Bubbles
165168
- [ ] Verbose
166169
167-
A widget may be hidden by setting its `visible` flag to `False`, if it is no longer in a layout,
168-
or if it has been offset beyond the edges of the terminal.
170+
Sent when any of the following conditions apply:
171+
172+
- The widget is removed from the DOM.
173+
- The widget is no longer displayed because it has been scrolled or clipped from the terminal or its container.
174+
- The widget has its `display` attribute set to `False`.
175+
- The widget's `display` style is set to `"none"`.
169176
"""
170177

171178

172179
class Ready(Event, bubble=False):
173-
"""Sent to the app when the DOM is ready.
180+
"""Sent to the `App` when the DOM is ready and the first frame has been displayed.
174181
175182
- [ ] Bubbles
176183
- [ ] Verbose
@@ -232,7 +239,7 @@ class Key(InputEvent):
232239
233240
Args:
234241
key: The key that was pressed.
235-
character: A printable character or ``None`` if it is not printable.
242+
character: A printable character or `None` if it is not printable.
236243
"""
237244

238245
__slots__ = ["key", "character", "aliases"]

0 commit comments

Comments
 (0)