~whereswaldon/gio-x

ref: 2edae8a2560135f81337aac777a83f170fda1a97 gio-x/notify/niotify_darwin.go -rw-r--r-- 497 bytes
2edae8a2Chris Waldon scroll: fix screenshot path 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//+build darwin

package notify

import (
	"gioui.org/x/notify/macos"
)

type macosManager struct {
	channel macos.NotificationChannel
}

func newManager() (Manager, error) {
	c := macos.NewNotificationChannel("Gio App")

	return Manager{
		&macosManager{channel: c},
	}, nil
}

func (a *macosManager) CreateNotification(title, text string) (*Notification, error) {
	notification, err := a.channel.Send(title, text)
	if err != nil {
		return nil, err
	}
	return &Notification{notification}, nil
}