This fixes a crash caused by closing a generated plot window in the app.
json.dump(data, f)
-# This seems to be necessary for Pyinstaller builds; not sure why.
+# The "macosx" backend is chosen by default on macOS and doesn't seem to play well with Tk.
+# https://discuss.python.org/t/tkinter-pyplot-crashes-appkit-on-macos/75590
if sys.platform == "darwin":
- matplotlib.use("macosx")
+ matplotlib.use("TkAgg")
model = MainModel(AutoJsonStorageMgr('data'), AutoJsonStorageMgr('state'))
view = MainView()