Applied, as there was no differing opinion. Wolfgang Lux wrote: > Fred Kiefer wrote: > >> Wolfgang Lux wrote: >>> The following patch fixes NSMenu's -indexOfItemWithTarget:andAction: >>> method so that it becomes possible to look up items with a nil target, >>> i.e., which send their action to the first responder. >> >> [...] >> I would like to hear some more opinions on those choices before deciding >> what to do. Perhaps somebody could check on Apple what they are doing? > > I think the best is to follow the specification from the NSMenu class, > which reads: > > - (int)indexOfItemWithTarget:(id)anObject andAction:(SEL)actionSelector > Parameters > anObject > An object that is set as the target of a menu item of the receiver. > actionSelector > A selector identifying an action method. If actionSelector is NULL, > the first menu item in the receiver that has target anObject is > returned > Return Value > The integer index of the menu item or, if no such menu item is in the > menu, –1. > > In my understanding, this implies that the use of isEqual: in method > indexOfItemWithTarget:andAction: was wrong in the first place and the > inner conditional should simply read > if ([menuItem target] == anObject) ... > I have updated the patch accordingly. > > Wolfgang > > >
_______________________________________________ Discuss-gnustep mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnustep
