Explain the significance of the before/after types (redux)

Follows on from https://github.com/Textualize/textual/pull/1641 where I did
the update for mounting via Widget but forgot about App.
This commit is contained in:
Dave Pearson
2023-01-24 15:15:46 +00:00
parent 2662e6b292
commit 92c03b0e11

View File

@@ -1095,8 +1095,12 @@ class App(Generic[ReturnType], DOMNode):
Args: Args:
*widgets: The widget(s) to mount. *widgets: The widget(s) to mount.
before: Optional location to mount before. before: Optional location to mount before. An `int` is the index
after: Optional location to mount after. of the child to mount before, a `str` is a `query_one` query to
find the widget to mount before.
after: Optional location to mount after. An `int` is the index
of the child to mount after, a `str` is a `query_one` query to
find the widget to mount after.
Returns: Returns:
An awaitable object that waits for widgets to be mounted. An awaitable object that waits for widgets to be mounted.
@@ -1120,8 +1124,12 @@ class App(Generic[ReturnType], DOMNode):
Args: Args:
widgets: An iterable of widgets. widgets: An iterable of widgets.
before: Optional location to mount before. before: Optional location to mount before. An `int` is the index
after: Optional location to mount after. of the child to mount before, a `str` is a `query_one` query to
find the widget to mount before.
after: Optional location to mount after. An `int` is the index
of the child to mount after, a `str` is a `query_one` query to
find the widget to mount after.
Returns: Returns:
An awaitable object that waits for widgets to be mounted. An awaitable object that waits for widgets to be mounted.