• 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
Extra call to validateMenuItem before triggering action; new in Leopard?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Extra call to validateMenuItem before triggering action; new in Leopard?


  • Subject: Extra call to validateMenuItem before triggering action; new in Leopard?
  • From: "Doug Knowles" <email@hidden>
  • Date: Sun, 9 Dec 2007 11:06:31 -0500

I'm seeing new behavior in my app under Leopard that's breaking things and
forcing me to work around it; is this intended?  (Or old behavior I was
sometimes missing?)
I have a menu associated with the header of an outline view, and I use
validateMenuItem to enable commands based on the column that was
right-clicked on to bring up the menu; therefore, the validation involves
using the mouse location to determine which column was under the cursor when
the mouseDown occurred.

The behavior that I'm seeing now is that validate... is called on the
initial mouseDown, and I correctly enable the items as I had done before.
 But now I'm seeing a second call to validateMenuItem on the selection of
the menu item, and my problem is that the mouse location (of the selected
menu item) is no longer within the header view or any of its columns, do my
validate... method returns NO, and the action is never triggered.

My planned workaround is to add a state to the menu item (via its
representedObject) to indicate that it has been validated, and use that to
return YES on the second invocation.  (My action handler will clear the
state.)

But if the 2nd call to validateMenuItem prior to the action is new and
intended behavior in Leopard, I'd like to know what the purpose is so I can
code appropriately.

TIA,

Doug Knowles
_______________________________________________

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: Extra call to validateMenuItem before triggering action; new in Leopard?
      • From: Peter Ammon <email@hidden>
  • Prev by Date: Re: Newbie: compare version string
  • Next by Date: Re: Core animation update layer properties
  • Previous by thread: Re: Core animation update layer properties
  • Next by thread: Re: Extra call to validateMenuItem before triggering action; new in Leopard?
  • Index(es):
    • Date
    • Thread