mirror of
https://github.com/netbirdio/systray.git
synced 2026-05-22 17:08:41 -07:00
update example
This commit is contained in:
+10
-6
@@ -10,6 +10,16 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
file, err := os.Create("out.txt")
|
||||
if err != nil {
|
||||
fmt.Println("Couldn't create out.txt")
|
||||
return
|
||||
}
|
||||
defer file.Close()
|
||||
onExit := func() {
|
||||
file.Write([]byte("On Exit..."))
|
||||
file.Sync()
|
||||
}
|
||||
// Should be called at the very beginning of main().
|
||||
systray.Run(onReady, onExit)
|
||||
}
|
||||
@@ -61,9 +71,3 @@ func onReady() {
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func onExit() {
|
||||
file, _ := os.Create("out.txt")
|
||||
defer file.Close()
|
||||
file.Write([]byte("On Exit..."))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user