Created
September 18, 2020 16:32
-
-
Save AlexeyGy/e904e3d692bc7b0d3cbaf535336657f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func setupSystray() { | |
| data, err := Asset("images/bitmap.ico") | |
| if err != nil { | |
| fmt.Println("Icon reading error", err) | |
| return | |
| } | |
| systray.SetTemplateIcon(data, data) | |
| systray.SetTitle("Insert Date") | |
| systray.SetTooltip("Insert the current date (Hotkey CTRL+ALT+D)") | |
| mQuitOrig := systray.AddMenuItem("Quit", "Quit the whole app") | |
| go func() { | |
| <-mQuitOrig.ClickedCh | |
| fmt.Println("Requesting quit") | |
| systray.Quit() | |
| fmt.Println("Finished quitting") | |
| }() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment