Re: modal window and quit menu item
Re: modal window and quit menu item
- Subject: Re: modal window and quit menu item
- From: Ken Thomases <email@hidden>
- Date: Fri, 18 Oct 2013 21:01:52 -0500
On Oct 18, 2013, at 6:35 PM, email@hidden wrote:
> Problem : quit menu stays active
> when a window is presented using [NSApp runModal:window].
What is the target of the Quit menu item? What is its action method? A typical setup is that its action method is -terminate: and its target is the main NIB's File's Owner, which is the application object.
Are you using a custom NSApplication subclass as your application object? Does it override -validateMenuItem:? If so, show us the implementation of that.
> Quitting causes the menu item to be permanently disabled.
> My [NSApp applicationShouldTerminate:] delegate message postpones the application
> termination as certain cleanup code doesn't work at all when invoked
> from the message.
Postpones how? In what sense does your cleanup code not work "when invoked from the message" (whatever that means)?
It is normal that the Quit menu item remains disabled after -applicationShouldTerminate: returns NSTerminateLater unless and until you call -replyToApplicationShouldTerminate: with NO.
> Does anyone know of a solution to either disable the quit menu item or re-enable the quit menu item.
Huh? Which do you want? In any case, if you want custom control over the Quit menu item, then you should implement -validateMenuItem: on its target. However, you should generally avoid doing that because the Quit menu item should behave as user's expect.
I think you need to step back and explain your high-level goal. Don't get bogged down yet in implementation. Describe your desired user interaction design.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden