From 8dc9741d8a13568a044f269d8c9a4d4b74bc9f7e Mon Sep 17 00:00:00 2001 From: JSP Date: Mon, 5 Apr 2021 14:44:17 +0300 Subject: [PATCH] Add Title() and Tooltip() accessor functions to MenuItem --- systray.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/systray.go b/systray.go index 8fe9d163..2be1e5b2 100644 --- a/systray.go +++ b/systray.go @@ -162,12 +162,22 @@ func (item *MenuItem) SetTitle(title string) { item.update() } +// Title returns the text displayed on a menu item +func (item *MenuItem) Title() string { + return item.title +} + // SetTooltip set the tooltip to show when mouse hover func (item *MenuItem) SetTooltip(tooltip string) { item.tooltip = tooltip item.update() } +// Tooltip returns the tooltip shown when mouse hover +func (item *MenuItem) Tooltip() string { + return item.tooltip +} + // Disabled checks if the menu item is disabled func (item *MenuItem) Disabled() bool { return item.disabled