|
@@ -1,4 +1,5 @@
|
|
from __future__ import annotations
|
|
from __future__ import annotations
|
|
|
|
+from justpy import WebPage
|
|
from typing import Any, Callable, Dict, Optional
|
|
from typing import Any, Callable, Dict, Optional
|
|
import traceback
|
|
import traceback
|
|
from ..events import MouseEventArguments, handle_event
|
|
from ..events import MouseEventArguments, handle_event
|
|
@@ -44,6 +45,11 @@ class AnnotationTool(Element):
|
|
except:
|
|
except:
|
|
traceback.print_exc()
|
|
traceback.print_exc()
|
|
|
|
|
|
|
|
+ async def set_source(self, source: str):
|
|
|
|
+ self.view.options.source = source
|
|
|
|
+ for socket in WebPage.sockets.get(self.page.page_id, {}).values():
|
|
|
|
+ await self.view.run_method(f'set_source("{source}")', socket)
|
|
|
|
+
|
|
@property
|
|
@property
|
|
def svg_content(self) -> str:
|
|
def svg_content(self) -> str:
|
|
return self.view.options.svg_content
|
|
return self.view.options.svg_content
|