Re: Allowing menu item selection in a modal session

2008-08-13 Thread Matt Neuburg
On Wed, 13 Aug 2008 15:11:47 +0800 (WST), [EMAIL PROTECTED] 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 PROTECTED], 
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: 
AppleScript: the Definitive Guide - Second Edition!




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Allowing menu item selection in a modal session

2008-08-13 Thread dcdeveloper
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?

Thanks!
Doug



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]