Problem with contextual menus
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.