• 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
Problem with contextual menus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with contextual menus


  • Subject: Problem with contextual menus
  • From: Andrew Merenbach <email@hidden>
  • Date: Wed, 24 Jul 2002 16:53:31 -0700

I looked at the MenuMadness example included with the developer tools, but the contextual menu it implemented was simply a connection to the main menu.

I'm working on a pure-Cocoa version of the Google Assistant program, and am trying to make a contextual menu wherein any item, when selected, will assume an "on" state, while the others will turn off.

I have the id googleMenu connected to the NSMenu in Interface Builder, and each item in the menu is connected to the following action:

- (IBAction)setGoogleMenu:(id)sender
{
NSString *itemTitle = [sender title];
NSMenuItem *menuItem = [googleMenu itemWithTitle:itemTitle];
[menuItem setState: NSOnState];
}

By all means, this should work. I know the routine gets executed, at the very least. But for some reason the state never gets set. As a test, I've tried adding a menu item in this same code, with no result. It is as if googleMenu never existed at all.

Is there something I'm missing?

Take care,
Andrew Merenbach
_______________________________________________
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.

  • Prev by Date: Re: Design Application
  • Next by Date: Can You Really Be Your Own Grandpa? (Inheritance problem)
  • Previous by thread: Re: NSTask problems.
  • Next by thread: Can You Really Be Your Own Grandpa? (Inheritance problem)
  • Index(es):
    • Date
    • Thread