Open d1y opened 3 years ago
I ran into this yesterday on an app that was working fine for MacOS, but wouldn't work on Windows. I found this article that indicated it seems to break if you try to do anything to the menu item before the icon is set.
For me, it was originally:
clientsMenuItem := systray.AddMenuItem("Clients", "Clients for which app is responsible")
systray.SetIcon(assets.Checkicon)
systray.SetTitle("appname")
systray.SetTooltip("app desc")
and it would give the same error you're seeing. I rearranged it to:
systray.SetIcon(assets.Checkicon)
systray.SetTitle("appname")
systray.SetTooltip("app desc")
clientsMenuItem := systray.AddMenuItem("Clients", "Clients for which app is responsible")
and it worked. Kind of strange, but there's something expected on the menu item set from those functions that's not immediately available or surfaced as an error shy of that obscure one you have in your logs.
Hello,
The article you mentioned is offline.
Here is my main.go: https://github.com/henri9813/iPingTray/blob/main/main.go
Do you know why it crashed based on my implementation ?
my Mac test is OK
Error report in Windows :(
What happened?
Thank you
the project link:
https://github.com/jsxxzy/inettray