mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
move timer callback param
This commit is contained in:
@@ -7,15 +7,16 @@ from textual.widget import Widget
|
||||
|
||||
|
||||
class Clock(Widget):
|
||||
async def on_mount(self, event):
|
||||
self.set_interval(1, callback=self.refresh)
|
||||
def on_mount(self):
|
||||
self.set_interval(1, self.refresh)
|
||||
|
||||
def render(self) -> Align:
|
||||
time = datetime.now().strftime("%X")
|
||||
def render(self):
|
||||
time = datetime.now().strftime("%c")
|
||||
return Align.center(time, vertical="middle")
|
||||
|
||||
|
||||
class ClockApp(App):
|
||||
async def on_mount(self, event):
|
||||
async def on_mount(self):
|
||||
await self.view.dock(Clock())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user