Download the custom file import window into my Cocoa application using:
[NSApp runModalForWindow:window];
The window displays just fine and is modal.
However, the main application menu is still active (for example, the File menu and items), which makes redundant display modal.
I searched for this, searched for stackoverflow and cocoa -dev, and searched for Apple docs, but can't find a way to disable the menu, or at least the selected menu items.
Someone suggested using this:
NSModalSession session = [NSApp beginModalSessionForWindow:window];
[NSApp runModalSession];
but it doesn’t work either. Again, the window is displayed modally, but the main menu is still active.
Can anyone suggest how to disable the main menu (gray menu items) when displaying a modal window?
Is there a way to do this at a time at the menu level, or do I need to disable each individual menu item?
I am missing a point somewhere, since this is the normal behavior in Cocoa applications.
thank
Darren.
source
share