I have a controller in which I setup a menu for a search field in a toolbar. The search field is set to return the whole search string. I have a procedure that looks basically like this:

-(void)setupSearchMenu
{
NSMenu *cellMenu = [[[NSMenu alloc] initWithTitle:@"Search Menu"] autorelease];
        
NSMenuItem *item;
        
item = [[[NSMenuItem alloc] initWithTitle:@"Item 1" action:@selector(setSearchCategoryFrom:) keyEquivalent:@""] autorelease];
        
[item setTarget:self];
[item setTag:0];
[item setState:1];
[cellMenu insertItem:item atIndex:0];

item = [[[NSMenuItem alloc] initWithTitle:@"Item 2" action:@selector(setSearchCategoryFrom:) keyEquivalent:@""] autorelease];
        
[item setTarget:self];
[item setTag:1];
[item setState:0];
[cellMenu insertItem:item atIndex:1];

id searchCell = [searchField cell];     
[searchCell setSearchMenuTemplate:cellMenu];
}

The procedure is fired only when the view in question becomes visible by user action (I have verified this with NSLog statements.) After this initialization takes place I flip check boxes to indicate what search mode a user is in as they make selections from the menu. This state is maintained right up to the point where enter is hit or the X in the search field is clicked at which point the menu reverts back to its initial state. This throws it out of sync with what the user has selected and I don't think the menu should change just because one search instance is triggered. Changing is the users decision. Is this behavior normal or am I doing something wrong in the construction of this menu or configuration of the search field?

TIA.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to