Skip to content

Instantly share code, notes, and snippets.

@AlexeyGy
Created September 18, 2020 16:32
Show Gist options
  • Save AlexeyGy/e904e3d692bc7b0d3cbaf535336657f2 to your computer and use it in GitHub Desktop.
Save AlexeyGy/e904e3d692bc7b0d3cbaf535336657f2 to your computer and use it in GitHub Desktop.
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