Implement toggle-style menu items with checkmarks
masterSince macOS menus dismiss immediately upon clicking an item, use the State field on a menuet.Regular item to show a checkmark for toggles. When the item is clicked, update your application state, and ensure the next time the menu is rendered, the State reflects the new value.
menuet.Regular{
Text: "Notifications enabled",
State: prefs.NotificationsEnabled,
Clicked: func() { prefs.NotificationsEnabled = !prefs.NotificationsEnabled },
}