Closed majiq3233 closed 3 years ago
Thank you for your report.
How did you create the menu? Please note that, as noted in the documentation, the menu
argument passed to the constructor must be an instance of pystray.Menu
. Using a tuple
or a list
will seemingly work, but crash for the default menu action.
tried two mini variants:
pystray.Icon('name', image, menu=(
item('Show', self.show_window, default=True),
item('Quit', self.close_app),
)
).run()
menu = (
item('Show', self.show_window, default=True),
item('Quit', self.close_app),
)
icon = pystray.Icon("name", image, "title", menu)
icon.run()
this code actually works:
image = Image.open("icon.ico")
menu = pystray.Menu(
item('Show', self.show_window, default=True),
item('Quit', self.quit_window),
)
icon = pystray.Icon("name", image, "title", menu)
icon.run()
menu = pystray.Menu(
python 3.9, Windows 10
When clicking the left button on the icon, an error appears:
TypeError: 'tuple' object is not callable
replace to fix: _base.py
old
new