• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Allowing menu item selection in a modal session
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: DICOM images in Cocoa
  • Next by Date: Re: @property and @synthesize not working
  • Previous by thread: Allowing menu item selection in a modal session
  • Next by thread: Checking whether Spotlight indexing is enabled for a volume
  • Index(es):
    • Date
    • Thread