objective c - Disable (grey out) main menu when displaying modal window? -


i load custom file import window in cocoa app using:

[nsapp runmodalforwindow:window];

the window displays fine, , modal.

however, application main menu still active (e.g. file menu , items), making modal display redundant.

i've googled this, searched stackoverflow , cocoa-dev, , searched apple docs, can't find way turn menu off, or @ least selected menu items.

someone suggested using this:

nsmodalsession session = [nsapp beginmodalsessionforwindow:window];
[nsapp runmodalsession];

but doesn't seem work either. again, window displays modally main menu still active.

can suggest how turn main menu off (grey out menu items) when displaying modal window please?

is there way in 1 go @ menu-level, or need turn off each individual menu item?

i must missing point somewhere, sort of menu behaviour common in cocoa apps.

thanks

darren.

i needed implement (in appdelegate) following method:

- (bool)validateuserinterfaceitem:(id <nsvalidateduserinterfaceitem>)anitem 

returning no disables referenced menu item.

all works fine now.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

sql server - python to mssql encoding problem -

windows - Python Service Installation - "Could not find PythonClass entry" -