https://github.com/zooyer/tray
go tray for windows
https://github.com/zooyer/tray
gotray tray tray-application tray-menu windows
Last synced: 5 months ago
JSON representation
go tray for windows
- Host: GitHub
- URL: https://github.com/zooyer/tray
- Owner: zooyer
- License: mit
- Created: 2020-05-10T16:04:08.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-28T17:49:33.000Z (almost 5 years ago)
- Last Synced: 2024-06-20T08:10:00.882Z (almost 2 years ago)
- Topics: gotray, tray, tray-application, tray-menu, windows
- Language: Go
- Size: 46.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go tray for windows
Go tray for windows.
#### Download and Install
```shell
go get github.com/zooyer/tray
```
#### Generate rsrc.syso(depend app.manifest)
```shell
go get github.com/akavel/rsrc
rsrc -arch amd64 -manifest app.manifest -o rsrc.syso
```
#### Example
```go
//go:generate rsrc -arch amd64 -manifest app.manifest -o rsrc.syso
func main() {
tray, err := New(&Options{
Tip: "test",
Icon: "./logo.ico",
Click: func(x, y int) {
fmt.Println("x:", x, "y:", y)
},
Menus: Menus{
{
Name: "test",
Action: func(tray *Tray) {
fmt.Println("click test")
},
},
{
Name: "exit",
Action: func(tray *Tray) {
_ = tray.Stop()
},
},
},
})
if err != nil {
t.Fatal(err)
}
tray.Message("running", "is running")
tray.Run()
}
```