Documentation ¶
Index ¶
- type ContextMenu
- type Manager
- func (m *Manager) AddContextMenu(contextMenu *menu.ContextMenu)
- func (m *Manager) AddTrayMenu(trayMenu *menu.TrayMenu)
- func (m *Manager) GetApplicationMenuJSON() string
- func (m *Manager) GetContextMenus() ([]string, error)
- func (m *Manager) GetTrayMenus() ([]string, error)
- func (m *Manager) ProcessClick(menuID string, data string, menuType string, parentID string) error
- func (m *Manager) SetApplicationMenu(applicationMenu *menu.Menu) error
- func (m *Manager) UpdateApplicationMenu() (string, error)
- func (m *Manager) UpdateContextMenu(contextMenu *menu.ContextMenu) (string, error)
- func (m *Manager) UpdateTrayMenu(trayMenu *menu.TrayMenu) (string, error)
- type MenuItemMap
- type ProcessedMenu
- type ProcessedMenuItem
- type RadioGroup
- type TrayMenu
- type WailsMenu
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextMenu ¶
type ContextMenu struct { ID string ProcessedMenu *WailsMenu // contains filtered or unexported fields }
func NewContextMenu ¶
func NewContextMenu(contextMenu *menu.ContextMenu) *ContextMenu
func (*ContextMenu) AsJSON ¶
func (t *ContextMenu) AsJSON() (string, error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func (*Manager) AddContextMenu ¶
func (m *Manager) AddContextMenu(contextMenu *menu.ContextMenu)
func (*Manager) AddTrayMenu ¶
func (*Manager) GetApplicationMenuJSON ¶
func (*Manager) GetContextMenus ¶
func (*Manager) GetTrayMenus ¶
func (*Manager) ProcessClick ¶
func (*Manager) SetApplicationMenu ¶
func (*Manager) UpdateApplicationMenu ¶
UpdateApplicationMenu reprocesses the application menu to pick up structure changes etc Returns the JSON representation of the updated menu
func (*Manager) UpdateContextMenu ¶
func (m *Manager) UpdateContextMenu(contextMenu *menu.ContextMenu) (string, error)
type MenuItemMap ¶
type MenuItemMap struct {
// contains filtered or unexported fields
}
MenuItemMap holds a mapping between menuIDs and menu items
func NewMenuItemMap ¶
func NewMenuItemMap() *MenuItemMap
func (*MenuItemMap) AddMenu ¶
func (m *MenuItemMap) AddMenu(menu *menu.Menu)
func (*MenuItemMap) Dump ¶
func (m *MenuItemMap) Dump()
type ProcessedMenu ¶
type ProcessedMenu struct {
Items []*ProcessedMenuItem
}
func NewProcessedMenu ¶
func NewProcessedMenu(menuItemMap *MenuItemMap, menu *menu.Menu) *ProcessedMenu
type ProcessedMenuItem ¶
type ProcessedMenuItem struct { ID string // Label is what appears as the menu text Label string // Role is a predefined menu type Role menu.Role `json:"Role,omitempty"` // Accelerator holds a representation of a key binding Accelerator *keys.Accelerator `json:"Accelerator,omitempty"` // Type of MenuItem, EG: Checkbox, Text, Separator, Radio, Submenu Type menu.Type // Disabled makes the item unselectable Disabled bool // Hidden ensures that the item is not shown in the menu Hidden bool // Checked indicates if the item is selected (used by Checkbox and Radio types only) Checked bool // Submenu contains a list of menu items that will be shown as a submenu //SubMenu []*MenuItem `json:"SubMenu,omitempty"` SubMenu *ProcessedMenu `json:"SubMenu,omitempty"` // Foreground colour in hex RGBA format EG: 0xFF0000FF = #FF0000FF = red Foreground int // Background colour Background int }
func NewProcessedMenuItem ¶
func NewProcessedMenuItem(menuItemMap *MenuItemMap, menuItem *menu.MenuItem) *ProcessedMenuItem
type RadioGroup ¶
RadioGroup holds all the members of the same radio group
type TrayMenu ¶
type TrayMenu struct { ID string Label string Icon string ProcessedMenu *WailsMenu // contains filtered or unexported fields }
func NewTrayMenu ¶
type WailsMenu ¶
type WailsMenu struct { Menu *ProcessedMenu RadioGroups []*RadioGroup // contains filtered or unexported fields }
WailsMenu is the original menu with the addition of radio groups extracted from the menu data
func NewWailsMenu ¶
func NewWailsMenu(menuItemMap *MenuItemMap, menu *menu.Menu) *WailsMenu
Click to show internal directories.
Click to hide internal directories.