mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge pull request #2646 from davep/fix-broken-xrefs
Fix some assorted documentation cross-references
This commit is contained in:
@@ -225,8 +225,8 @@ The main screen is darkened to indicate to the user that it is not active, and o
|
|||||||
It is a common requirement for screens to be able to return data.
|
It is a common requirement for screens to be able to return data.
|
||||||
For instance, you may want a screen to show a dialog and have the result of that dialog processed *after* the screen has been popped.
|
For instance, you may want a screen to show a dialog and have the result of that dialog processed *after* the screen has been popped.
|
||||||
|
|
||||||
To return data from a screen, call [`dismiss()`][textual.screen.dismiss] on the screen with the data you wish to return.
|
To return data from a screen, call [`dismiss()`][textual.screen.Screen.dismiss] on the screen with the data you wish to return.
|
||||||
This will pop the screen and invoke a callback set when the screen was pushed (with [`push_screen`][textual.app.push_screen]).
|
This will pop the screen and invoke a callback set when the screen was pushed (with [`push_screen`][textual.app.App.push_screen]).
|
||||||
|
|
||||||
Let's modify the previous example to use `dismiss` rather than an explicit `pop_screen`.
|
Let's modify the previous example to use `dismiss` rather than an explicit `pop_screen`.
|
||||||
|
|
||||||
|
|||||||
@@ -778,7 +778,7 @@ class Screen(Generic[ScreenResultType], Widget):
|
|||||||
def dismiss(self, result: ScreenResultType | Type[_NoResult] = _NoResult) -> None:
|
def dismiss(self, result: ScreenResultType | Type[_NoResult] = _NoResult) -> None:
|
||||||
"""Dismiss the screen, optionally with a result.
|
"""Dismiss the screen, optionally with a result.
|
||||||
|
|
||||||
If `result` is provided and a callback was set when the screen was [pushed][textual.app.push_screen], then
|
If `result` is provided and a callback was set when the screen was [pushed][textual.app.App.push_screen], then
|
||||||
the callback will be invoked with `result`.
|
the callback will be invoked with `result`.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|||||||
@@ -183,11 +183,6 @@ class Tabs(Widget, can_focus=True):
|
|||||||
ALLOW_SELECTOR_MATCH = {"tab"}
|
ALLOW_SELECTOR_MATCH = {"tab"}
|
||||||
"""Additional message attributes that can be used with the [`on` decorator][textual.on]."""
|
"""Additional message attributes that can be used with the [`on` decorator][textual.on]."""
|
||||||
|
|
||||||
tabs: Tabs
|
|
||||||
"""The tabs widget containing the tab."""
|
|
||||||
tab: Tab
|
|
||||||
"""The tab that was activated."""
|
|
||||||
|
|
||||||
def __init__(self, tabs: Tabs, tab: Tab) -> None:
|
def __init__(self, tabs: Tabs, tab: Tab) -> None:
|
||||||
"""Initialize event.
|
"""Initialize event.
|
||||||
|
|
||||||
@@ -195,8 +190,10 @@ class Tabs(Widget, can_focus=True):
|
|||||||
tabs: The Tabs widget.
|
tabs: The Tabs widget.
|
||||||
tab: The tab that was activated.
|
tab: The tab that was activated.
|
||||||
"""
|
"""
|
||||||
self.tabs = tabs
|
self.tabs: Tabs = tabs
|
||||||
self.tab = tab
|
"""The tabs widget containing the tab."""
|
||||||
|
self.tab: Tab = tab
|
||||||
|
"""The tab that was activated."""
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -215,16 +212,14 @@ class Tabs(Widget, can_focus=True):
|
|||||||
class Cleared(Message):
|
class Cleared(Message):
|
||||||
"""Sent when there are no active tabs."""
|
"""Sent when there are no active tabs."""
|
||||||
|
|
||||||
tabs: Tabs
|
|
||||||
"""The tabs widget which was cleared."""
|
|
||||||
|
|
||||||
def __init__(self, tabs: Tabs) -> None:
|
def __init__(self, tabs: Tabs) -> None:
|
||||||
"""Initialize the event.
|
"""Initialize the event.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
tabs: The tabs widget.
|
tabs: The tabs widget.
|
||||||
"""
|
"""
|
||||||
self.tabs = tabs
|
self.tabs: Tabs = tabs
|
||||||
|
"""The tabs widget which was cleared."""
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in New Issue
Block a user