Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with contextual menus



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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.