Re: Enabling menu items?
Re: Enabling menu items?
- Subject: Re: Enabling menu items?
- From: Ron Fleckner <email@hidden>
- Date: Wed, 25 Jul 2007 22:26:33 +1000
Date: Wed, 25 Jul 2007 10:47:10 +0200
From: Kai-Mikael J??-Aro <email@hidden>
Subject: Enabling menu items?
Clearly I'm making some trivial mistake, but I can't locate it by
myself and thus ask for your ever-useful help:
I have a Cocoa application which has an Edit menu containing Cut,
Copy and Paste items. These are in Interface Builder connected to
cut: copy: and paste: methods in FirstResponder, respectively. The
application window has its outlet initialFirstResponder connected to
EditorView, which is a subclass of NSView located inside the window.
EditorView implements
-(BOOL) accceptsFirstResponder {
return(YES);
}
and
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)
anItem {
return(YES);
}
It also declares and implements
-(IBAction) cut: (id) sender;
-(IBAction) copy: (id) sender;
-(IBAction) paste: (id) sender;
But, in spite of all this, all items in the Edit menu are disabled
when running the program. What have I forgotten to add to this?
Just a guess: perhaps you need to change the return type of the
methods to void. If this fails, why not just disconnect the original
menu item connections in FirstResponder and connect them to your
methods?
Ron
_______________________________________________
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