Re: FW: Enabling and Disabling menus
Re: FW: Enabling and Disabling menus
- Subject: Re: FW: Enabling and Disabling menus
- From: Ondra Cada <email@hidden>
- Date: Wed, 22 Aug 2001 23:39:50 +0200
Henri,
>
>>>>> Henri Lamiraux (HL) wrote at Wed, 22 Aug 2001 13:37:52 -0700:
HL> 2 - No, -validateMenuItem: is called when the menu is pulled down (you
HL> wan the user to see the menu disabled before he can select it) or when
HL> the user press some Command key equivalent.
Hmmmm, would have something to do with events as well. Since the following
code (tested in MOSXS1!):
@interface Controller : NSObject {
BOOL currentState;
}
- (void)menuAction:(id)sender;
@end
@implementation Controller
-(BOOL)validateMenuItem:(NSMenuItem*)item {
return !currentState; // ! just to have YES by default
}
- (void)menuAction:(id)sender {
currentState=!currentState;
[self performSelector:_cmd withObject:nil afterDelay:5];
}
@end
does not "blink" the item in torn off menu (pity, it should ;), but *ANY*
action (like clicking app's window outside all widgets) is sufficient to
redraw the torn off menu properly.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc