From 247213e20fd2b796fa12b1e6dfdd2f1524431bc1 Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Sun, 24 Dec 2023 21:19:42 -0700 Subject: [PATCH] Quit simulator when executable quits --- remarkable_sim/sim.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/remarkable_sim/sim.py b/remarkable_sim/sim.py index a77e2d7..c674a4f 100644 --- a/remarkable_sim/sim.py +++ b/remarkable_sim/sim.py @@ -223,6 +223,8 @@ def load_screen(self): else: print(path_fb + " not found") + self.poll_executable() + # ----- Event Callbacks ----- # handle multi button press @@ -313,6 +315,11 @@ def screen_release(self, event): if self.input.get() == 'Touch': pass + def poll_executable(self): + if self.subprocess is None or self.subprocess.poll() is None: + return + + sys.exit(0) def main(): parser = argparse.ArgumentParser()