Skip to content

Commit b4eb4b1

Browse files
authored
Added logbox_clear function
1 parent e9a97f3 commit b4eb4b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pywebio_battery/interaction.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ def logbox_append(name: str, text: str):
240240
run_js('$("#webio-logbox-%s").append(document.createTextNode(text))' % name, text=str(text))
241241

242242

243+
def logbox_clear(name: str):
244+
"""Clear all contents of a logbox widget"""
245+
pywebio.session.run_js('$("#webio-logbox-%s").empty()' % name)
246+
247+
243248
def put_video(src: Union[str, bytes], autoplay: bool = False, loop: bool = False,
244249
height: int = None, width: int = None, muted: bool = False, poster: str = None,
245250
scope: str = None, position: int = OutputPosition.BOTTOM) -> Output:

0 commit comments

Comments
 (0)