mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
depth first search
This commit is contained in:
9
sandbox/will/screens_focus.css
Normal file
9
sandbox/will/screens_focus.css
Normal file
@@ -0,0 +1,9 @@
|
||||
Focusable {
|
||||
padding: 3 6;
|
||||
background: blue 20%;
|
||||
}
|
||||
|
||||
Focusable :focus {
|
||||
border: solid red;
|
||||
}
|
||||
|
||||
20
sandbox/will/screens_focus.py
Normal file
20
sandbox/will/screens_focus.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import Static, Footer
|
||||
|
||||
|
||||
class Focusable(Static, can_focus=True):
|
||||
pass
|
||||
|
||||
|
||||
class ScreensFocusApp(App):
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Focusable("App - one")
|
||||
yield Focusable("App - two")
|
||||
yield Focusable("App - three")
|
||||
yield Focusable("App - four")
|
||||
yield Footer()
|
||||
|
||||
|
||||
app = ScreensFocusApp(css_path="screens_focus.css")
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
Reference in New Issue
Block a user