Skip to content

Commit 3aac1c9

Browse files
authored
update put_logbox demo
1 parent be974de commit 3aac1c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pywebio_battery/interaction.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,13 @@ def put_logbox(name: str, height=400, keep_bottom=True) -> Output:
200200
:name: battery-put-logbox
201201
:summary: Logbox widget
202202
203-
from pywebio_battery import put_logbox, logbox_append # ..demo-only
203+
from pywebio.output import put_button
204+
from pywebio_battery import put_logbox, logbox_append, logbox_clear # ..demo-only
204205
# ..demo-only
205206
import time
206207
207208
put_logbox("log")
209+
put_button('Clear', lambda: logbox_clear("log"))
208210
while True:
209211
logbox_append("log", f"{time.time()}\n")
210212
time.sleep(0.2)

0 commit comments

Comments
 (0)