• 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
How disable File/Open command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How disable File/Open command


  • Subject: How disable File/Open command
  • From: "McLaughlin, Michael P." <email@hidden>
  • Date: Mon, 15 Aug 2011 09:08:57 -0400
  • Acceptlanguage: en-US
  • Thread-topic: How disable File/Open command

I have a Cocoa document app targeting Snow Leopard.  It is, in most respects, a standard document app except that, given an input file, it launches a long, multi-threaded computation.  Consequently, it can handle only one input file at a time.

For the obvious reasons, I would very much like to disable the File/Open… command while the computation is proceeding.  However, nothing I have been able to find seems to work with this command.  For instance, the code below will disable the Open Recent command but the Open command seems immune.

I have also tried to intercept the Open command in myDocController.m with a call to


-(BOOL)validateMenuItem:(id)sender

but that doesn't work either.

I know that this must be an old problem, recognized and solved long ago.  Could someone please point me to the solution.  Sample code would be especially nice.

Thank you very much.

________________________________

      NSMenu *mFile = [[[NSApp mainMenu] itemWithTitle:@"File"] submenu];

      [[mFile itemAtIndex:0] setEnabled:NO];   // Open… --> doesn't work!!

      [[mFile itemAtIndex:1] setEnabled:NO];   // Open Recent


--
Mike McLaughlin

_______________________________________________

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

  • Follow-Ups:
    • Re: How disable File/Open command
      • From: Vyacheslav Karamov <email@hidden>
  • Prev by Date: Re: Graphical Keyboard Map
  • Next by Date: Re: How disable File/Open command
  • Previous by thread: Re: Graphical Keyboard Map
  • Next by thread: Re: How disable File/Open command
  • Index(es):
    • Date
    • Thread