diff --git a/appstore.py b/appstore.py index 85ada50d..4c083a46 100644 --- a/appstore.py +++ b/appstore.py @@ -524,7 +524,22 @@ print("Child coroutine: Exiting") app2_script = """ import time -print("Child coroutine: Creating UI") +import _thread +print("App2 running") + +# Quit flag +should_continue = True + +def app2_thread(): + count=0 + while should_continue: + print(f"app2_thread: thread_id {_thread.get_ident()} - {count}") + count+=1 + time.sleep(4) + +_thread.start_new_thread(app2_thread, ()) + + # Label label = lv.label(subwindow) label.set_text("App2: 0") @@ -541,8 +556,6 @@ slider = lv.slider(subwindow) slider.set_range(0, 100) slider.set_value(50, lv.ANIM.OFF) slider.align(lv.ALIGN.BOTTOM_MID, 0, -30) -# Quit flag -should_continue = True # Button callback def button_cb(e): global should_continue @@ -554,6 +567,9 @@ def slider_cb(e): value = slider.get_value() #print("Child slider value:", value) slider.add_event_cb(slider_cb, lv.EVENT.VALUE_CHANGED, None) + + + # Update loop count = 0 while should_continue: