Skip to content
Discussion options

You must be logged in to vote
// Package systray provides a macOS-specific system tray implementation.
package systray

type MenuItem struct {
	id         int
	title      string
	handler    func()
	ref        any
	subMenu    *Menu
	parentMenu *Menu
	isSubMenu  bool
}

type Menu struct {
	items []*MenuItem
	ref   any
}

var rootMenu *Menu

// Initialize initializes the systray
func Initialize() {
	rootMenu = &Menu{
		items: make([]*MenuItem, 0),
	}
	initialize()
}

func SetIcon(iconPath string)            { updateIcon(iconPath) }
func SetTooltip(tooltipText string)      { updateTooltip(tooltipText) }
func SetIconClickHandler(handler func()) { updateIconClickHandler(handler) }
func AddSeparator()                      { a…

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by alexec
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@alexec
Comment options

@leaanthony
Comment options

@leaanthony
Comment options

@dosubot
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Enhancement New feature or request v2
3 participants
Converted from issue

This discussion was converted from issue #4496 on August 17, 2025 04:06.