mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 06:51:08 +00:00
In [update] use [NSApplication targetForAction:to:from:] to be
consistent with the [performActionForItemAtIndex:] implementation. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17660 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
bbeec6b247
commit
2882fa9d28
1 changed files with 6 additions and 25 deletions
|
@ -750,7 +750,6 @@ static NSNotificationCenter *nc;
|
|||
{
|
||||
NSMenuItem *item = [_items objectAtIndex: i];
|
||||
SEL action = [item action];
|
||||
id target;
|
||||
id validator = nil;
|
||||
BOOL wasEnabled = [item isEnabled];
|
||||
BOOL shouldBeEnabled;
|
||||
|
@ -762,35 +761,17 @@ static NSNotificationCenter *nc;
|
|||
// If there is no action - there can be no validator for the item.
|
||||
if (action)
|
||||
{
|
||||
// If there is a target use that for validation (or nil).
|
||||
if (nil != (target = [item target]))
|
||||
{
|
||||
if ([target respondsToSelector: action])
|
||||
{
|
||||
validator = target;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
validator = [NSApp targetForAction: action];
|
||||
}
|
||||
validator = [NSApp targetForAction: action
|
||||
to: [item target]
|
||||
from: item];
|
||||
}
|
||||
else if (_popUpButtonCell != nil)
|
||||
{
|
||||
if (NULL != (action = [_popUpButtonCell action]))
|
||||
{
|
||||
// If there is a target use that for validation (or nil).
|
||||
if (nil != (target = [_popUpButtonCell target]))
|
||||
{
|
||||
if ([target respondsToSelector: action])
|
||||
{
|
||||
validator = target;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
validator = [NSApp targetForAction: action];
|
||||
}
|
||||
validator = [NSApp targetForAction: action
|
||||
to: [_popUpButtonCell target]
|
||||
from: [_popUpButtonCell controlView]];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue