|
@@ -1,3 +1,4 @@
|
|
|
+import asyncio
|
|
|
from typing import Callable, Optional
|
|
|
|
|
|
from ..colors import set_background_color
|
|
@@ -34,3 +35,9 @@ class Button(TextElement, DisableableElement):
|
|
|
|
|
|
def _text_to_model_text(self, text: str) -> None:
|
|
|
self._props['label'] = text
|
|
|
+
|
|
|
+ async def clicked(self):
|
|
|
+ event = asyncio.Event()
|
|
|
+ self.on('click', event.set)
|
|
|
+ await self.client.connected()
|
|
|
+ await event.wait()
|