Documentation ¶
Index ¶
- Variables
- func AddSeparator()
- func Quit()
- func Run(onRun func())
- func SetIcon(iconBytes []byte)
- func SetTooltip(tooltip string)
- type Menu
- func (m *Menu) AddMenuItem(title string, onClick func(*MenuItem)) *MenuItem
- func (m *Menu) AddNewMenuItem(menuItem interfaces.MenuItem) int32
- func (m *Menu) AddSeparator()
- func (m *Menu) AddSubMenuItem(title string) *Menu
- func (m Menu) GetHandle() uintptr
- func (m *Menu) RemoveMenuItem(menuItem interfaces.MenuItem)
- type MenuItem
Constants ¶
This section is empty.
Variables ¶
var ( // OnExitChan can be optionally waited on for detecting and handling the shutdown of the tray application OnExitChan = make(chan bool) )
Functions ¶
func AddSeparator ¶
func AddSeparator()
AddSeparator will add a seperator between items in the tray menu
func Quit ¶
func Quit()
Quit will close the tray application, the OnExitChan will be triggered after the application has shut down
func Run ¶
func Run(onRun func())
Run is called to start the tray application and the callback is triggered when it is up and running
func SetIcon ¶
func SetIcon(iconBytes []byte)
SetIcon will set the icon for the tray application in the system tray
func SetTooltip ¶
func SetTooltip(tooltip string)
SetTooltip will set a tooltip on hover over the system tray icon
Types ¶
type Menu ¶
type Menu struct {
// contains filtered or unexported fields
}
Menu represents the top level or sub menus of a tray application
func AddSubMenuItem ¶
AddSubMenuItem will add a new sub menu to the tray menu. The sub menu is returned, allowing the adding of items to it
func (*Menu) AddMenuItem ¶
AddMenuItem will add an item to the menu
func (*Menu) AddNewMenuItem ¶
func (m *Menu) AddNewMenuItem(menuItem interfaces.MenuItem) int32
AddNewMenuItem implements the interfaces.Menu interface allowing platform specific code to keep track of menu positions when adding or updating a menu
func (*Menu) AddSeparator ¶
func (m *Menu) AddSeparator()
AddSeparator will add a seperator to the menu
func (*Menu) AddSubMenuItem ¶
AddSubMenuItem will add a sub menu to the menu
func (Menu) GetHandle ¶
GetHandle will return the platform specific pointer to the raw menu resource
func (*Menu) RemoveMenuItem ¶
func (m *Menu) RemoveMenuItem(menuItem interfaces.MenuItem)
RemoveMenuItem implements the interfaces.Menu interface allowing platform specific code to remove items from the menu in their current positions
type MenuItem ¶
type MenuItem struct {
// contains filtered or unexported fields
}
MenuItem represents an item displayed in the root or a sub menu of the tray application It can be disabled, checked or have the title updated
func AddMenuItem ¶
AddMenuItem will add a new item to the tray menu with an on click callback
func (MenuItem) IsDisabled ¶
IsDisabled will allow the checking of the disabled state of the item
func (*MenuItem) ToggleDisabled ¶
func (m *MenuItem) ToggleDisabled()
ToggleDisabled will switch the disabled state on the item
func (*MenuItem) ToogleChecked ¶
func (m *MenuItem) ToogleChecked()
ToogleChecked will switch the checked state on the item