Always select the popup item in performAction

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13920 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2002-06-19 15:00:17 +00:00
parent 8e986bb0db
commit 33a9bfaf78

View file

@ -735,6 +735,14 @@ static NSNotificationCenter *nc;
[nc postNotificationName: NSMenuWillSendActionNotification
object: self
userInfo: d];
if (_popUpButtonCell != nil)
{
// Tell the popup button, which item was selected
[_popUpButtonCell selectItemAtIndex: index];
}
if ((action = [item action]) != NULL)
{
[NSApp sendAction: action
@ -743,9 +751,7 @@ static NSNotificationCenter *nc;
}
else if (_popUpButtonCell != nil)
{
// Tell the popup button, which item was selected
[_popUpButtonCell selectItemAtIndex: index];
if (NULL != (action = [_popUpButtonCell action]))
if ((action = [_popUpButtonCell action]) != NULL)
[NSApp sendAction: action
to: [_popUpButtonCell target]
from: [_popUpButtonCell controlView]];