-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to skip adding the default Quit option #44
Comments
Hello. Yes, I'm interested in this too. Also, changing the language would be useful. |
FWIW, I was also looking for a way to do this and ultimately I also landed on using systray = SysTrayIcon(...)
systray._menu_options.pop()
systray.start() I never feel great using private attributes like this, but it works. I did notice, however, that if you define no menu options at all then the app will quit (or maybe crash, but there's no error message) after you double-click the system tray icon. I suspect this has to do with this (per the README):
To get around this, you can define a menu item that just does nothing, but at least one menu item has to exist. # this menu item does nothing but display some text
# if you leave the text blank, you'll still get an empty rectangle
menu_options = (('v1.0.0', None, lambda _systray: None),) NB: changing |
I would like a way to avoid adding the default Quit option. I have two reasons:
I don't fully understand the deadlock issue but it is bad interaction across threads and it is somehow related to the unique wiring that the "on_quit" option has. The short story is that this works perfectly:
While
causes deadlocks on context manager exit in any situation other than clicking the "Close" button on the menu, due to some internals of server.cancel().
The text was updated successfully, but these errors were encountered: