• 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: forcing menu validation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: forcing menu validation


  • Subject: Re: forcing menu validation
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 19 Nov 2008 19:01:46 -0800

On Nov 19, 2008, at 18:34, Mudi Dandan wrote:

I'm using automatic menu validation.
The problem comes from that I exchange close window/close tab (as in Safari) shortcuts during the validation process.
Unfortunately -validateUserInterfaceItem: doesn't seem to be called when pressing a shortcut, so hitting command-w will close the window instead of the current tab. Using the mouse it would work fine.

Aside from the issue of whether this is a good thing to do, I think it's not going to work because you're making an assumption that isn't true.


Switching a key equivalent at validation time could only work if all menu items were validated *before* the menu item corresponding to the key equivalent is found. I just tried this, and AFAICT it finds the menu item *first* and validates just that item. That means you're pretty much out luck, as far as doing it at validation time.

This behavior contradicts the documentation:

http://developer.apple.com/documentation/Cocoa/Conceptual/MenuList/Articles/EnablingMenuItems.html#/ /apple_ref/doc/uid/20000261-74653-BAJBGJHB

"When you use automatic menu enabling, NSMenu updates the status of every menu item whenever a user event occurs."

I think we already knew that it didn't happen literally every event, but the part about "every menu item" also appears to be false in the key equivalent case.



_______________________________________________

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: forcing menu validation
      • From: Mudi Dandan <email@hidden>
References: 
 >forcing menu validation (From: Mudi Dandan <email@hidden>)
 >Re: forcing menu validation (From: "Kyle Sluder" <email@hidden>)
 >Re: forcing menu validation (From: Mudi Dandan <email@hidden>)

  • Prev by Date: Re: forcing menu validation
  • Next by Date: Re: forcing menu validation
  • Previous by thread: Re: forcing menu validation
  • Next by thread: Re: forcing menu validation
  • Index(es):
    • Date
    • Thread