mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
refactor of compositor
This commit is contained in:
@@ -17,7 +17,7 @@ class Clock(Widget):
|
||||
|
||||
class ClockApp(App):
|
||||
async def on_mount(self):
|
||||
await self.view.dock(Clock())
|
||||
await self.screen.dock(Clock())
|
||||
|
||||
|
||||
ClockApp.run()
|
||||
|
||||
@@ -26,7 +26,7 @@ class HoverApp(App):
|
||||
"""Build layout here."""
|
||||
|
||||
hovers = (Hover() for _ in range(10))
|
||||
await self.view.dock(*hovers, edge="top")
|
||||
await self.screen.dock(*hovers, edge="top")
|
||||
|
||||
|
||||
HoverApp.run(log="textual.log")
|
||||
|
||||
@@ -8,8 +8,8 @@ class SimpleApp(App):
|
||||
async def on_mount(self) -> None:
|
||||
"""Build layout here."""
|
||||
|
||||
await self.view.dock(Placeholder(), edge="left", size=40)
|
||||
await self.view.dock(Placeholder(), Placeholder(), edge="top")
|
||||
await self.screen.dock(Placeholder(), edge="left", size=40)
|
||||
await self.screen.dock(Placeholder(), Placeholder(), edge="top")
|
||||
|
||||
|
||||
SimpleApp.run(log="textual.log")
|
||||
|
||||
Reference in New Issue
Block a user