how am i suppose to choose which of the menu items i want to address in a function like this? the following function enables or disables all menu items that are present...
i've searching for hours and it seems that something simple like disabling a menu item should be easier than it is... a simple void function something like this would be great, but it won't work... won't it?
Code:
- (BOOL)validateMenuItem:(NSMenuItem *)item
{
if ([mainWindow isVisible])
return NO;
else
return YES;
}
i've searching for hours and it seems that something simple like disabling a menu item should be easier than it is... a simple void function something like this would be great, but it won't work... won't it?
Code:
-(void)disableThisItem
{
if ([mainWimdow isVisible] && [itemWithTitle:@"Make Window Visible" isEnabled])
{
[disable itemWithTitle:@"Make Window Visible"]
}
}