Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
✨ Example of Textualize/textual#3677
Browse files Browse the repository at this point in the history
  • Loading branch information
davep committed Nov 14, 2023
1 parent 557fad6 commit 3545b8c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions loading_overlay.py
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

0 comments on commit 3545b8c

Please sign in to comment.