aboutsummaryrefslogtreecommitdiffstats
path: root/example/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'example/main.go')
-rw-r--r--example/main.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/example/main.go b/example/main.go
index 01b9ee8..46604d5 100644
--- a/example/main.go
+++ b/example/main.go
@@ -2,6 +2,8 @@ package main
import (
"fmt"
+ "os"
+
"github.com/getlantern/systray"
"github.com/getlantern/systray/example/icon"
"github.com/skratchdot/open-golang/open"
@@ -9,7 +11,7 @@ import (
func main() {
// Should be called at the very beginning of main().
- systray.Run(onReady)
+ systray.Run(onReady, onExit)
}
func onReady() {
@@ -59,3 +61,9 @@ func onReady() {
}
}()
}
+
+func onExit() {
+ file, _ := os.Create("out.txt")
+ defer file.Close()
+ file.Write([]byte("On Exit..."))
+}