An open API service indexing awesome lists of open source software.

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

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()
}
```