PDA

View Full Version : How to disable the Quit func under the mutilDocument environment ?




xiaohuli170
Apr 13, 2009, 10:10 PM
I haove a mutilDocument App , I found that when I open a window with the method : [NSApp beginSheet: [MultiWin window] modalForWindow: mainWindows modalDelegate: nil didEndSelector: nil contextInfo: nil]; The Quit func in mainmeny already highlight , this can confuse the user that the Quit app func can work under this vironment.I want to disable the Quit func under that , how to do? Thank you very much!



kainjow
Apr 14, 2009, 01:17 AM
To be honest I wouldn't worry about this too much. This is "standard' behavior and happens in most Cocoa apps.

But if you really do want to do this, you need to implement validateMenuItem: