Last active
May 2, 2020 18:03
-
-
Save guaychou/a4a6b1ab84fb57c99bb25c7d454e6b1e 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 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