• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSMenuItem states...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSMenuItem states...
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Sending email programmatically
  • Next by Date: Re: reading postscript file
  • Previous by thread: Re: Strange NSString result from NSURL ?
  • Next by thread: Re: NSMenuItem states...
  • Index(es):
    • Date
    • Thread