FIx NSTextView model trans. View removal

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7245 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2000-08-25 14:25:38 +00:00
parent 2c13cc926c
commit b237cbdc26
2 changed files with 19 additions and 2 deletions

View file

@ -397,13 +397,20 @@ GSSetDragTypes(NSView* obj, NSArray *types)
- (void) removeSubview: (NSView*)aSubview
{
id view;
/*
* This must be first because it invokes -resignFirstResponder:,
* which assumes the view is still in the view hierarchy
*/
if ([_window firstResponder] == aSubview)
for (view = [_window firstResponder];
view != nil && [view respondsToSelector:@selector(superview)];
view = [view superview] )
{
[_window makeFirstResponder: _window];
if (view == aSubview)
{
[_window makeFirstResponder: _window];
break;
}
}
aSubview->_super_view = nil;
[aSubview viewWillMoveToWindow: nil];