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:
Wolfgang Lux 2012-02-19 16:22:49 +00:00
parent e654c1c5b5
commit 1d0294acc2
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>
* Headers/AppKit/NSGraphicsContext.h: Extend the enumerator

View file

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

View file

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