5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-16 17:09:28 +08:00
wails/v2/pkg/menu/menuitem.go
2020-11-24 20:12:10 +11:00

29 lines
556 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
Disabled bool
Hidden bool
Checked bool
SubMenu []*MenuItem `json:"SubMenu,omitempty"`
}
func Text(label string, id string) *MenuItem {
return &MenuItem{
Id: id,
Label: label,
Type: TextType,
}
}
// Separator provides a menu separator
func Separator() *MenuItem {
return &MenuItem{
Type: SeparatorType,
}
}