Skip to content

Commit

Permalink
Add Title() and Tooltip() accessor functions to MenuItem
Browse files Browse the repository at this point in the history
  • Loading branch information
realitycheck committed Apr 5, 2021
1 parent 2c0986d commit 8dc9741
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions systray.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8dc9741

Please sign in to comment.