Revert change from r34642 which has broken OS X compatibility and fix

sender of a pop up button's action when it is sent through one of the
menu items.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34781 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2012-02-19 16:22:49 +00:00
parent d83aa2565a
commit 744e61d204
3 changed files with 20 additions and 8 deletions

View file

@ -1,3 +1,14 @@
2012-02-19 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSMenu.m (-performActionForItemAtIndex:): Revert change
from r34642. The action of a pop up menu item once again is chosen
in preference to the action of the pop up button itself. This is
how it has always worked on OS X.
* Source/NSPopUpButtonCell.m (_popUpItemAction): Fix sender of the
pop up button's action. It is now the pop up button itself and not
the pop up button cell.
2012-02-18 Fred Kiefer <FredKiefer@gmx.de> 2012-02-18 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSGraphicsContext.h: Extend the enumerator * Headers/AppKit/NSGraphicsContext.h: Extend the enumerator

View file

@ -1310,17 +1310,18 @@ static BOOL menuBarVisible = YES;
[_popUpButtonCell selectItemAtIndex: index]; [_popUpButtonCell selectItemAtIndex: index];
} }
if (_popUpButtonCell != nil && (action = [_popUpButtonCell action]) != NULL) if ((action = [item action]) != NULL)
{ {
[NSApp sendAction: action [NSApp sendAction: action
to: [_popUpButtonCell target] to: [item target]
from: [_popUpButtonCell controlView]]; from: item];
} }
else if ((action = [item action]) != NULL) else if (_popUpButtonCell != nil)
{ {
[NSApp sendAction: action if ((action = [_popUpButtonCell action]) != NULL)
to: [item target] [NSApp sendAction: action
from: item]; to: [_popUpButtonCell target]
from: [_popUpButtonCell controlView]];
} }
[nc postNotificationName: NSMenuDidSendActionNotification [nc postNotificationName: NSMenuDidSendActionNotification

View file

@ -1366,7 +1366,7 @@ static NSImage *_pbc_image[5];
[theBinding reverseSetValueFor: NSSelectedObjectBinding]; [theBinding reverseSetValueFor: NSSelectedObjectBinding];
} }
[NSApp sendAction: [self action] to: [self target] from: self]; [NSApp sendAction: [self action] to: [self target] from: _control_view];
} }
@end @end