• 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: Copy via Pasteboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copy via Pasteboard


  • Subject: Re: Copy via Pasteboard
  • From: Stefan Jung <email@hidden>
  • Date: Tue, 10 Jul 2001 14:35:42 +0200

Thank You Stiphane,

Am Dienstag, 10. Juli 2001 um 12:04 schrieb Stiphane Sudre:

> - (BOOL) validateMenuItem:(NSMenuItem *)anItem
I was wrong here, because I wrote validateMenuItem instead of
validateMenuItem: :-)
> {
> SEL action = [anItem action];
>
> if (action==@selector(copy:))
> {
> return YES;
> }
>
> return YES;
I think you meant "return NO;"
> }

Unfortunately this method isn't called either. I double checked
with a breakpoint in it.
On the other hand acceptsFirstResponder is called when I click
the view. becomeFirstResponder and resignFirstResponder are not
called. Is there pattern slowly building up now?

I reread the documentation and the NSMenuValidation section
clearly states:
If NSMenu finds an object that responds to the action message, it
then checks to see if that object responds to the
validateMenuItem: method (the method declared in this informal
protocol)
If this is right then validateMenuItem: is not necessary, because
If validateMenuItem: is not implemented in that object, the menu
item is enabled. If it is implemented, the return value of
validateMenuItem: indicates whether the menu item should be
enabled or disabled.

Making the initialFirstResponder connection from the window to
the view (in Interface Builder) does not help.

Stefan


  • Follow-Ups:
    • Re: Copy via Pasteboard
      • From: "David P. Henderson" <email@hidden>
References: 
 >Re: Copy via Pasteboard (From: Stéphane Sudre <email@hidden>)

  • Prev by Date: Getting an NSView's size
  • Next by Date: Re: Security FrameWork Help
  • Previous by thread: Re: Copy via Pasteboard
  • Next by thread: Re: Copy via Pasteboard
  • Index(es):
    • Date
    • Thread