Can it works on Mac OS?
When run the sample code on mac os 11.6.
I got a error:AttributeError: 'Icon' object has no attribute '_status_item'
Can you post the entire error message?
Sure, Error stack here:
/Users/username/anaconda3/envs/envname/bin/python /Users/username/Documents/Projects/Geek/envname/psg_tray.py
* Error performing wm_overrideredirect while hiding the hidden master root* expected boolean value but got ""
Exception in thread Thread-1:
Traceback (most recent call last):
File "/Users/username/anaconda3/envs/envname/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/Users/username/anaconda3/envs/envname/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/Users/username/anaconda3/envs/envname/lib/python3.9/site-packages/psgtray/psgtray.py", line 183, in _pystray_thread
self.tray_icon.menu = pystray.Menu(*self.menu_items)
File "/Users/username/anaconda3/envs/envname/lib/python3.9/site-packages/pystray/_base.py", line 141, in menu
self.update_menu()
File "/Users/username/anaconda3/envs/envname/lib/python3.9/site-packages/pystray/_base.py", line 216, in update_menu
self._update_menu()
File "/Users/username/anaconda3/envs/envname/lib/python3.9/site-packages/pystray/_darwin.py", line 81, in _update_menu
self._status_item.setMenu_(None)
AttributeError: 'Icon' object has no attribute '_status_item'
Process finished with exit code 1
The System Tray feature is being supplied by a package named pystray... which reminds me that my readme certainly needs to be updated to reflect this.
You'll find that package here: https://github.com/moses-palmer/pystray
The error is definitely occurring within pystray. The docs for pystray indicate that the Mac is supported and I see from the error message that the error is happening in _darwin.py so it does appear they are at least getting to the right area in their code. It would be worth logging at Issue with them with the error trace and see if they have some ideas. Moses has been responsive in the past to my questions.
Thanks for your research and patience. I'm trying to get help from the author of pystray.
I'll join in with you over there.... not going to leave you to figure it out on your own....
That'd be great thanks :)
New post here:
https://github.com/moses-palmer/pystray/issues/101