diff --git a/internal_filesystem/builtin/apps/com.micropythonos.osupdate/assets/osupdate.py b/internal_filesystem/builtin/apps/com.micropythonos.osupdate/assets/osupdate.py index 0e547c33..dee8933c 100644 --- a/internal_filesystem/builtin/apps/com.micropythonos.osupdate/assets/osupdate.py +++ b/internal_filesystem/builtin/apps/com.micropythonos.osupdate/assets/osupdate.py @@ -29,7 +29,8 @@ class OSUpdate(Activity): self.current_version_label.set_text(f"Installed OS version: {mpos.info.CURRENT_OS_VERSION}") self.force_update = lv.checkbox(self.main_screen) self.force_update.set_text("Force Update") - self.force_update.add_event_cb(lambda *args: self.force_update_clicked(), lv.EVENT.CLICKED, None) + self.force_update.add_event_cb(lambda *args: self.force_update_clicked(), lv.EVENT.VALUE_CHANGED, None) + #self.force_update.add_event_cb(lambda e: mpos.ui.print_event(e), lv.EVENT.ALL, None) self.force_update.align_to(self.current_version_label, lv.ALIGN.OUT_BOTTOM_LEFT, 0, mpos.ui.pct_of_display_height(5)) self.install_button = lv.button(self.main_screen) self.install_button.align(lv.ALIGN.TOP_RIGHT, 0, 0) diff --git a/internal_filesystem/lib/mpos/ui/__init__.py b/internal_filesystem/lib/mpos/ui/__init__.py index 9bb3ef9d..578f8804 100644 --- a/internal_filesystem/lib/mpos/ui/__init__.py +++ b/internal_filesystem/lib/mpos/ui/__init__.py @@ -144,6 +144,27 @@ def get_event_name(event_code): return EVENT_MAP.get(event_code, f"Unknown event {event_code}") +def print_event(event): + global canvas + event_code=event.get_code() + #print(f"got event {event_code}") + # Ignore: + # ======= + # 19: HIT_TEST + # COVER_CHECK + # DRAW_MAIN + # DRAW_MAIN_BEGIN + # DRAW_MAIN_END + # 31: DRAW_POST_BEGIN + # 32: DRAW_POST + # 33: DRAW_POST_END + # 39: CHILD_CHANGED + # 52: GET_SELF_SIZE + if event_code not in [19,23,25,26,27,28,29,30,31, 32, 33, 39,49, 52]: + name = get_event_name(event_code) + target_obj=event.get_target_obj() + print(f"{target_obj} got event code={event_code}, name={name}") + def close_top_layer_msgboxes(): """ Iterate through all widgets in lv.layer_top() and close any lv.msgbox instances.