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

@ -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