Skip to content

Instantly share code, notes, and snippets.

@guaychou
Last active May 2, 2020 18:03
func onReady(){
go func() {
var result string
var err error
for {
result,err=pingGoogle()
if err!=nil{
systray.SetTitle(err.Error())
}else{
systray.SetTitle(result)
time.Sleep(2 * time.Second)
}
}
}()
systray.AddSeparator()
mQuit := systray.AddMenuItem("Quit", "Quits this app")
go func() {
for {
select {
case <-mQuit.ClickedCh:
systray.Quit()
return
}
}
}()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment