Re: Enable a NSMenuItem created programmatically
Re: Enable a NSMenuItem created programmatically
- Subject: Re: Enable a NSMenuItem created programmatically
- From: Jim Correia <email@hidden>
- Date: Sun, 30 Mar 2003 10:11:32 -0500
On Sunday, March 30, 2003, at 10:01 AM, Arthur VIGAN wrote:
my application creates a menu programmatically to handles changes in
the applications state, and I have a problem with the items created. I
use the following to make the items:
myMenuItem = [[NSMenuItem alloc] initWithTitle:@"The title"
action:@selector(myAction) keyEquivalent:@""];
[myMenu insertItem:myMenuItem atIndex:0];
the method myAction is in the same class that create the menu items
and the menu.
The problem is that the item stays disabled when the application
runs... even if I use [myMenuItem setEnabled:YES];
Where is the problem?
What does myAction look like?
- (IBAction)myAction:(id)sender
{
// do something
}
If so, then the selector is
@selector(myAction:)
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.