On this page
fyne.MenuItem
import "fyne.io/fyne/v2"Usage
type MenuItem
type MenuItem struct {
ChildMenu *Menu
// Since: 2.1
IsQuit bool
IsSeparator bool
Label string
Action func() `json:"-"`
// Since: 2.1
Disabled bool
// Since: 2.1
Checked bool
// Since: 2.2
Icon Resource
// Since: 2.2
Shortcut Shortcut
}MenuItem is a single item within any menu, it contains a display Label and Action function that is called when tapped.
func NewMenuItem
func NewMenuItem(label string, action func()) *MenuItemNewMenuItem creates a new menu item from the passed label and action parameters.
func NewMenuItemSeparator
func NewMenuItemSeparator() *MenuItemNewMenuItemSeparator creates a menu item that is to be used as a separator.
func NewMenuItemWithIcon
func NewMenuItemWithIcon(label string, icon Resource, action func()) *MenuItemNewMenuItemWithIcon creates a new menu item from the passed label, icon, and action parameters.
Since:
2.7