Re: Copy via Pasteboard
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