Re: NSMenuItem: [ ] Bug [ ] Unexpected Behavior [ ] Answer forthcoming
Re: NSMenuItem: [ ] Bug [ ] Unexpected Behavior [ ] Answer forthcoming
- Subject: Re: NSMenuItem: [ ] Bug [ ] Unexpected Behavior [ ] Answer forthcoming
- From: Stéphane Sudre <email@hidden>
- Date: Mon, 28 May 2001 12:41:17 +0200
On vendredi, mai 25, 2001, at 08:18 , Andrew Platzer wrote:
On Friday, May 25, 2001, at 08:30 , Stiphane Sudre wrote:
From what I've seen, a NSMenuItem in a NSMenu in a the menu bar when it
is created in IB is disabled as long as there is no Action/Target
linked to it.
[...]
Usually, it's something like:
- (BOOL)validateUserInterfaceItem:(id)anItem {
SEL action = [anItem action];
if (action==@selector(myAction:)) {
return [self myActionEnabled];
}
return NO; // disabled
}
OK. I think it's a perfect solution since what defines a menu is almost
always its action.
Am I correct to assume that in fact [NSMenuItem setEnabled:]; is a
method which is only useful for PopUp Menu as the one in the
NSPopUpButton ?