moses-palmer / pystray

GNU General Public License v3.0
482 stars 59 forks source link

Error left-click on the tray icon #106

Closed jdima07 closed 2 years ago

jdima07 commented 2 years ago

Hello! Why do I get an error on windows when I left-click on the tray icon?

An error occurred when calling message handler Traceback (most recent call last): File "D:\Program Files\Python37\lib\site-packages\pystray_win32.py", line 402, in _dispatcher uMsg, lambda w, l: 0)(wParam, lParam) or 0) File "D:\Program Files\Python37\lib\site-packages\pystray_win32.py", line 190, in _on_notify self() File "D:\Program Files\Python37\lib\site-packages\pystray_base.py", line 104, in call self._menu(self) TypeError: 'tuple' object is not callable

I think a mistake in the call to the self._menu method, I do not understand why it is called if it is a tuple with menu objects.

moses-palmer commented 2 years ago

Thank you for your report.

A temporary workaround is to pass an instance of Menu as the menu argument instead of a tuple. If you install pystray from the master branch, this has been fixed, so I will close this issue.