NSMenuItem states...
NSMenuItem states...
- Subject: NSMenuItem states...
- From: email@hidden
- Date: Wed, 28 Jan 2004 14:57:29 -0800
ok so i check a dictionary for the menuitem to see if status is true or
false (status is a boolean value in the dictionary)
- (void)menuWillPopUp:(NSNotification *)aNotification;
{
NSMenuItem *item;
NSEnumerator *enumerator = [[nameMenu itemArray] objectEnumerator];
while(item = [enumerator nextObject])
{
if (![item isSeparatorItem])
{
NSDictionary *tempDict = [NSDictionary
dictionaryWithDictionary:[ABFieldsDict dictionaryForKey:[item title]]];
if([tempDict boolForKey:@"status"])
{
[[nameMenu itemWithTitle:[item title]] setState:NSOnState];
}
else
{
[[nameMenu itemWithTitle:[item title]] setState:NSOffState];
}
}
}
}
so what happens is i can select a menuitem which sets the state to true
then i can select it again to set it false, but then if i try to select
it agin it doesn't appear checked when it pops up next, i've checked
the value in the dictionary and it is set to true but then menu just
doesn't check again? any suggestions? is my code incorrect i've also
tried called menu update but this doesn't seem to help either?
_______________________________________________
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.