Declare to Make Mac MenuItems behave like Windows?

I’ve previously tried setting the action and / or the target but got the same result as you.

I did read somewhere that the solution was to set the action to Nil and make validateMenuItem: return Yes (true). I tried to implement validateMenuItem via method swizzling but couldn’t get it to work.

yeah there’s not much you’re going to be able to do about that. That method is on the target object and since it was deprecated, was moved to NSDocument. I don’t think we have a chance in hell of overriding that method now.

I’m not talking about the enabled state here. Submenus should be enabled in order to see what’s inside.
But selecting an item which contains a sub menu (i.e. clicking on it or pressing return/enter) shouldn’t make a choice and close the menu.

3 Likes