• 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: validateMenuItem() not always being called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: validateMenuItem() not always being called


  • Subject: Re: validateMenuItem() not always being called
  • From: email@hidden
  • Date: Sun, 18 May 2008 23:05:41 -0400

Hi

  else
   {
       enable = [super validateMenuItem:menuItem];
   }
I wasn't, but when I did, it still was only called for the File menu.

-validateMenuItem: is deprecated; you should probably be using
-validateUserInterfaceItem:
Tried validateUserInterfaceItem, no change.

I recommend Hillegass's standard, Cocoa Programming for
Mac OS X, Third Edition (the previous editions may confuse you as
Interface Builder has drastically changed with Leopard).
I forgot to mention I'm on Tiger with Xcode 2.5.
I have Learning Cocoa With Objective-C, 2nd Edition O'Reilly.

In particular, keep in mind the
actions that the File menu items have versus the actions of all other
menu items, and why this would cause AppKit to only invoke your
document's -validateMenuItem: method for File menu items.
The example "SimpleToolbar" has a validateMenuItem method in MyDocument.m and it too only gets
called for the File menu but the Edit menu is properly updated for Cut, Copy and Paste.
I guess NSTextView handles it.


thanks
Jeff


_______________________________________________

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: validateMenuItem() not always being called
      • From: Jens Alfke <email@hidden>
    • Re: validateMenuItem() not always being called
      • From: "Kyle Sluder" <email@hidden>
References: 
 >Re: validateMenuItem() not always being called (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: Re: Cocoa bindings and reluctance to use NSPopupButon
  • Next by Date: Re: Cocoa et al as HCI usability problem
  • Previous by thread: Re: validateMenuItem() not always being called
  • Next by thread: Re: validateMenuItem() not always being called
  • Index(es):
    • Date
    • Thread