• 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: "Kyle Sluder" <email@hidden>
  • Date: Sun, 18 May 2008 23:26:50 -0400

On Sun, May 18, 2008 at 11:05 PM,  <email@hidden> wrote:
> 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.

Correct.  NSText responds to -cut:, -copy:, and -paste:, and since
NSTextView derives from NSText, its -validateUserInterfaceItem: method
is called when the menu and toolbar items with these actions need to
be updated and an NSTextView has the focus.  (Insert description of
the field editor and such here.)

Re-read the documentation about the responder chain, and make sure you
fully understand it.  It's one of the most powerful aspects of AppKit,
and it's really fricken cool to boot.  For me, it meant no more
gigantic switch statements that I was used to in Win32 programming.

--Kyle Sluder
_______________________________________________

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

  • Prev by Date: Re: Cocoa et al as HCI usability problem
  • 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