FROM : malcom
DATE : Wed Jul 19 19:30:47 2006
Hi list,
I would to add a categories menu (ex: search for Subject, Body or ...)
in my NSSearchField. I've successfully set the menu but there is a
problem if I try to set a menuitem to state:NSOffState.
When I select a menu it should be to turn off the previous selected
category. This is the code:
- (IBAction) menu_selectNewFilter:(id) sender {
NSMenuItem *m = [searchMenu itemWithTag: selectedFilter];
[m setState: NSOffState];
NSLog(@"Disabled %@ %d",[m title],[m tag]);
NSLog(@"Activate %@ %d",[sender title],[sender tag]);
[sender setState: NSOnState];
selectedFilter = [sender tag];
}
It works for ONState but the previous item state will never change
(I've also tried to take a look at the debugger and, in fact the state
of NSOffState menuitem is 0...but the checkmark icon still here!).
Is there a problem with this class or is it a problem of mine?
DATE : Wed Jul 19 19:30:47 2006
Hi list,
I would to add a categories menu (ex: search for Subject, Body or ...)
in my NSSearchField. I've successfully set the menu but there is a
problem if I try to set a menuitem to state:NSOffState.
When I select a menu it should be to turn off the previous selected
category. This is the code:
- (IBAction) menu_selectNewFilter:(id) sender {
NSMenuItem *m = [searchMenu itemWithTag: selectedFilter];
[m setState: NSOffState];
NSLog(@"Disabled %@ %d",[m title],[m tag]);
NSLog(@"Activate %@ %d",[sender title],[sender tag]);
[sender setState: NSOnState];
selectedFilter = [sender tag];
}
It works for ONState but the previous item state will never change
(I've also tried to take a look at the debugger and, in fact the state
of NSOffState menuitem is 0...but the checkmark icon still here!).
Is there a problem with this class or is it a problem of mine?
| Related mails | Author | Date |
|---|---|---|
| malcom | Jul 19, 19:30 | |
| Adam Knight | Jul 19, 19:37 | |
| malcom | Jul 19, 19:40 | |
| malcom | Jul 19, 21:07 | |
| Matt Neuburg | Jul 19, 21:36 |






Cocoa mail archive

