Skip to content
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

updating menu options (maybe a feature request) #17

Open
MagTun opened this issue Mar 28, 2019 · 6 comments
Open

updating menu options (maybe a feature request) #17

MagTun opened this issue Mar 28, 2019 · 6 comments

Comments

@MagTun
Copy link

MagTun commented Mar 28, 2019

I have a script that can run either in mute mode and unmute mode. I would like to be able to switch between these two mode by right-clicking on the icon of my script in the systray menu and selecting a menu.
So far, the only way I could to do this with infi.systray is by having 2 menu options, one mute and the other one unmute.

Would it be possible to only have a single menu option whose label would be "mute" when my script is unmute and whose label would be unmute when my script is mute.

Maybe we could also have menu with checkmark. so the label would always be for instance mute and then with either a checkmark or not.

Thanks for sharing your work!

@MagTun MagTun changed the title menu options with checkmark (maybe a feature request) updating menu options (maybe a feature request) Mar 28, 2019
@WiliTest
Copy link

WiliTest commented Apr 3, 2019

+1: Yes, it would be great to have some ON/OFF, ENABLED/DISABLED on a dynamic menu.

@wiggin15
Copy link
Contributor

wiggin15 commented Apr 3, 2019

Unfortunately, I won't have time to work on this, but I am open to pull requests.

@MagTun
Copy link
Author

MagTun commented Apr 5, 2019

I have created 2 pull requests (one for traybar.py and one for readme.md).

@Syazvinski
Copy link

Syazvinski commented Jan 26, 2021

I have created 2 pull requests (one for traybar.py and one for readme.md).

Has this been implemented? I get the error TypeError: update() got an unexpected keyword argument 'menu_options' When using the below code.

from infi.systray import SysTrayIcon

def say_hello(systray):
        systray.update(menu_options=menu_optionsbye)
def say_bye(systray):
        systray.update(menu_options=menu_optionshello)
menu_optionshello = (("Say Hello","hello.ico", say_hello),)
menu_optionsbye = (("Say Bye", "bye.ico", say_bye),)
systray = SysTrayIcon("icon.ico", "Hello/Bye", menu_optionshello)   
systray.start()

@danperks
Copy link

I was just about to post this. The pull requests from @MagTun have been included, but the updates have not been pushed to the version available from pip install infi.systray. If someone could push this update to pip, that'd be great :) @wiggin15

@odoluca
Copy link

odoluca commented Oct 4, 2021

any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants