When looking for the target for an action, if the key window is associated

with a document, return it


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16575 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2003-04-28 12:16:35 +00:00
parent adc4a725ed
commit 6942ad64d5

View file

@ -1581,7 +1581,7 @@ Returns the target object that will respond to aSelector, if any. The
method first checks if any of the key window's first responders, the
key window or its delegate responds. Next it checks the main window in
the same way. Finally it checks the receiver (NSApplication) and it's
delegate.
delegate.
</p>
*/
- (id) targetForAction: (SEL)aSelector
@ -1606,11 +1606,23 @@ delegate.
{
return keyWindow;
}
resp = [keyWindow delegate];
if (resp != nil && [resp respondsToSelector: aSelector])
{
return resp;
}
if ([NSDocumentController isDocumentBasedApplication])
{
resp = [[NSDocumentController sharedDocumentController]
documentForWindow: keyWindow];
if (resp != nil && [resp respondsToSelector: aSelector])
{
return resp;
}
}
}
if (_session != 0)