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

Commit

Permalink
✨ Add an illustration for Textualize/textual#3517
Browse files Browse the repository at this point in the history
  • Loading branch information
davep committed Oct 12, 2023
1 parent e54ef13 commit 043b2aa
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions loading_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""https://github.com/Textualize/textual/issues/3517"""

from textual.app import App, ComposeResult
from textual.containers import Grid, Container

class BusyBox(Container, can_focus=True):

DEFAULT_CSS = """
BusyBox {
border: panel red;
}
BusyBox:focus {
border: panel green;
}
"""

def __init__(self, number: int) -> None:
super().__init__()
self.border_title = f"Busy box {number}"
self.loading = bool(number % 3)

class LoadingApp(App[None]):

CSS = """
Grid {
grid-size: 4;
}
"""

def compose(self) -> ComposeResult:
with Grid():
for n in range(16):
yield BusyBox(n)

if __name__ == "__main__":
LoadingApp().run()

### loading_test.py ends here

0 comments on commit 043b2aa

Please sign in to comment.