Re: Allowing menu item selection in a modal session
Re: Allowing menu item selection in a modal session
- Subject: Re: Allowing menu item selection in a modal session
- From: Matt Neuburg <email@hidden>
- Date: Wed, 13 Aug 2008 19:19:32 -0700
- Thread-topic: Allowing menu item selection in a modal session
On Wed, 13 Aug 2008 15:11:47 +0800 (WST), email@hidden said:
>Hi,
>
>I have an application that sometimes runs a modal window (entered via
>[NSApplication runModalForWindow:]). During this modal session, I'd like
>to allow the user to select a menu item (namely, the "Quit" item),
>however, all menu items are automatically disabled when the modal session
>is entered.
>
>Is there any way to keep a menu item enabled during a modal session?
In the case of the Quit item, since this is connected directly to the app
object, you will have to subclass the application class, declare your
subclass as the target's primary class, and in your subclass implement
validateMenuItem and worksWhenModal. See, always see:
http://www.cocoabuilder.com/archive/message/cocoa/2004/10/7/119051
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
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