Re: Why are my menu items gray?
Re: Why are my menu items gray?
- Subject: Re: Why are my menu items gray?
- From: Henry McGilton <email@hidden>
- Date: Wed, 23 Apr 2003 08:18:08 -0700
On Wednesday, April 23, 2003, at 07:48 AM, Peter Karlsson wrote:
Dear list!
Can someone please tell me why my menu items are gray'ed out? It
builds 10 menu items, all with the title 'Cocoa', as expected, but
they are all gray and can't be clicked.
int menuNum;
NSMenuItem *menuItem;
for(menuNum=0; menuNum <10; menuNum ++)
{
menuItem = [[NSMenuItem alloc] initWithTitle:@"Cocoa"
action:@selector(deviceAction:)keyEquivalent:@""];
[menuItem setTarget:menuOutlet];
[deviceOutlet addItem:menuItem];
}
Peter
You may well have to setEnabled: YES on the items as well.
Alternatively, take a look at the NSMenuValidation protocol
for enabling and disabling menu items dynamically.
Best Wishes,
........ Henry
===============================+============================
Henry McGilton | Trilithon Software
Boulevardier, Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden |
http://www.trilithon.com
===============================+============================
_______________________________________________
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.