Closed ReenigneArcher closed 2 years ago
Thank you for your report.
How to gracefully stop your application really depends on other libraries and frameworks used in your application, so I cannot give a generic answer.
I notice, however, that you call run_detached
, so pystray is not in charge of your main loop. Perhaps Flask is? In that case, graceful shutdown would simply be to terminate your Flask application in tray_quit
. You would have to consult the documentation on how to do this.
Hello, I am having a problem attempting to have a menu item that quits my program (a Flask application) using
sys.exit(0)
.I have attempted to simplify the code here:
When clicking "Quit" in the system tray menu, I get the following traceback (note that line numbers and modules are different than the code above):
Do you have any suggestions for how to gracefully exit from a system tray menu command?