aboutsummaryrefslogtreecommitdiffstats
path: root/systray_nonwindows.go
diff options
context:
space:
mode:
Diffstat (limited to 'systray_nonwindows.go')
-rw-r--r--systray_nonwindows.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/systray_nonwindows.go b/systray_nonwindows.go
index 0ed03b4..4868b55 100644
--- a/systray_nonwindows.go
+++ b/systray_nonwindows.go
@@ -60,6 +60,13 @@ func addOrUpdateMenuItem(item *MenuItem) {
)
}
+// SetIcon sets the icon of a menu item. Only available on Mac.
+// iconBytes should be the content of .ico/.jpg/.png
+func (item *MenuItem) SetIcon(iconBytes []byte) {
+ cstr := (*C.char)(unsafe.Pointer(&iconBytes[0]))
+ C.setMenuItemIcon(cstr, (C.int)(len(iconBytes)), C.int(item.id))
+}
+
func addSeparator(id int32) {
C.add_separator(C.int(id))
}