Changed decoding to support decoding of NSBox too (that class is special

because it overrides -addSubview:)


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5566 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 1999-12-17 23:24:44 +00:00
parent 85dd064e7e
commit fe990f712f

View file

@ -2504,7 +2504,23 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
e = [subs objectEnumerator];
while ((sub = [e nextObject]) != nil)
{
[self addSubview: sub];
// We can't use [self addSubview: sub]; because NSBox overrides
// that method: we need to take the long way.
if ([self isDescendantOf: sub])
{
NSLog(@"Operation addSubview: creates a loop in the views tree!\n");
continue;
}
RETAIN (sub);
[sub removeFromSuperview];
[sub viewWillMoveToWindow: window];
[sub viewWillMoveToSuperview: self];
[sub setNextResponder: self];
[sub_views addObject: sub];
_rFlags.has_subviews = 1;
[sub resetCursorRects];
[sub setNeedsDisplay: YES];
RELEASE(sub);
}
RELEASE(subs);