I'm trying to disable a menuItem of a popUp button in a macOS app. I get to set the state to on or off (the checkmark of the menu item), but I haven't found a way to set the enabled to false (greyed out).
func disableMyItem() {
let myItem = actionButton.item(withTitle: "Test Item") // creating the NSMenuItem object
myItem?.state = NSOffState // remove checkmark
myItem?.isEnabled = false // has no effect
print(myItem?.isEnabled) // "Optional(false)"
}