5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-15 08:29:29 +08:00
wails/v2/pkg/menu/menuitem.go
2020-11-24 19:43:25 +11:00

31 lines
598 B
Go

package menu
type MenuItem struct {
Id string `json:"Id,omitempty"`
Label string
Role Role `json:"Role,omitempty"`
Accelerator string `json:"Accelerator,omitempty"`
Type Type
Enabled bool
Visible bool
Checked bool
SubMenu []*MenuItem `json:"SubMenu,omitempty"`
}
func Text(label string, id string) *MenuItem {
return &MenuItem{
Id: id,
Label: label,
Type: NormalType,
Enabled: true,
Visible: true,
}
}
// Separator provides a menu separator
func Separator() *MenuItem {
return &MenuItem{
Type: SeparatorType,
}
}