diff options
| author | joesis | 2017-09-12 22:37:40 +0800 | 
|---|---|---|
| committer | GitHub | 2017-09-12 22:37:40 +0800 | 
| commit | 060c06f22e631c46a2d738532bc81c37b0f31595 (patch) | |
| tree | 174769c64d8b1254d4f4203655b42b38f0c0c63e /systray.go | |
| parent | 66e6fad5eea92d7adda31abfae7a5a52070dfae5 (diff) | |
| parent | e00812af2c109a6cfa4c9a4774e4f805b6119290 (diff) | |
| download | systray-060c06f22e631c46a2d738532bc81c37b0f31595.tar.bz2 | |
Merge pull request #31 from getlantern/issue881
Add ability to show/hide menu items
Diffstat (limited to 'systray.go')
| -rw-r--r-- | systray.go | 12 | 
1 files changed, 11 insertions, 1 deletions
| @@ -46,7 +46,7 @@ var (  	menuItems     = make(map[int32]*MenuItem)  	menuItemsLock sync.RWMutex -	currentID int32 +	currentID = int32(-1)  )  // Run initializes GUI and starts the event loop, then invokes the onReady @@ -129,6 +129,16 @@ func (item *MenuItem) Disable() {  	item.update()  } +// Hide hides a menu item +func (item *MenuItem) Hide() { +	hideMenuItem(item) +} + +// Show shows a previously hidden menu item +func (item *MenuItem) Show() { +	showMenuItem(item) +} +  // Checked returns if the menu item has a check mark  func (item *MenuItem) Checked() bool {  	return item.checked | 
