Re: Handling a menu item in a modal dialog


James Walker
 

On 8/13/18 6:55 PM, Andy Lee via Groups.Io wrote:
On Aug 13, 2018, at 9:05 PM, James Walker <list2@...> wrote:
By the way, there are other menu items, implemented in the app delegate, that are enabled while the dialog is running.  Seems like there's something special about the Quit item.  Maybe that's related to the fact that Quit isn't in the menu nib, but gets added magically.
I got curious and created a scratch app to fiddle with.  I called [NSApp runModalForWindow:] and was surprised to see that even though the dialog was demonstrably modal (clicking on the window behind it caused a beep), the Quit menu item was enabled.  I'll send you my mini-project off-list in case it helps.

Thanks, that did help.  I think the root of the problem is that my app is not totally a normal Cocoa app.  I am in the process of converting a complex app from Carbon to Cocoa, and though I no longer have any Carbon windows, the overall structure and event handling is still somewhat Carbonated.

Join cocoa@apple-dev.groups.io to automatically receive all group messages.