This repository has been archived by the owner on Jun 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Example of Textualize/textual#3677
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""https://github.com/Textualize/textual/issues/3677""" | ||
|
||
from textual.app import App, ComposeResult | ||
from textual.widgets import Label | ||
|
||
class LoadingOverlayApp(App[None]): | ||
|
||
CSS = """ | ||
Label { | ||
width: 90%; | ||
height: 1fr; | ||
text-align: center; | ||
border: solid red; | ||
} | ||
""" | ||
|
||
def compose(self) -> ComposeResult: | ||
yield Label("This is a really big label") | ||
|
||
def on_mount(self) -> None: | ||
self.notify( | ||
"This is a really big notification. Loading should not overwrite it.", | ||
timeout=9_999_999 | ||
) | ||
self.query_one(Label).loading = True | ||
|
||
if __name__ == "__main__": | ||
LoadingOverlayApp().run() | ||
|
||
### loading_overlay.py ends here |