aboutsummaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
authorOx Cart2017-08-25 13:07:25 -0500
committerOx Cart2017-08-25 16:16:48 -0500
commit351a4b68603fd5d5b013d9a680d8d97650510cd6 (patch)
tree2babc5a4ef2b1b9be2c68952f511ec12f80a93b6 /example
parentef254071ef3abfdf0a220f76fcdd468d24bff519 (diff)
downloadsystray-351a4b68603fd5d5b013d9a680d8d97650510cd6.tar.bz2
Made onExit run reliably and process terminate on quit
Diffstat (limited to 'example')
-rw-r--r--example/main.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/example/main.go b/example/main.go
index e2193be..ee78d42 100644
--- a/example/main.go
+++ b/example/main.go
@@ -17,8 +17,10 @@ func main() {
}
defer file.Close()
onExit := func() {
- file.Write([]byte("On Exit..."))
+ fmt.Println("Starting onExit")
+ file.Write([]byte("On Exit...\n"))
file.Sync()
+ fmt.Println("Finished onExit")
}
// Should be called at the very beginning of main().
systray.Run(onReady, onExit)
@@ -31,8 +33,9 @@ func onReady() {
mQuit := systray.AddMenuItem("Quit", "Quit the whole app")
go func() {
<-mQuit.ClickedCh
+ fmt.Println("Requesting quit")
systray.Quit()
- fmt.Println("Quit now...")
+ fmt.Println("Finished quitting")
}()
// We can manipulate the systray in other goroutines