Add two Cocoa debug helper methods.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29924 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2010-03-13 15:17:21 +00:00
parent 8924d931c0
commit 46bba406d0
3 changed files with 42 additions and 0 deletions

View file

@ -458,6 +458,33 @@ GSSetDragTypes(NSView* obj, NSArray *types)
return frame;
}
- (NSString*) _subtreeDescriptionWithPrefix: (NSString*)prefix
{
NSMutableString *desc = [[NSMutableString alloc] init];
NSEnumerator *e;
NSView *v;
[desc appendFormat: @"%@%@\n", prefix, [self description], nil];
prefix = [prefix stringByAppendingString: @" "];
e = [_sub_views objectEnumerator];
while ((v = (NSView*)[e nextObject]) != nil)
{
[desc appendString: [v _subtreeDescriptionWithPrefix: prefix]];
}
return desc;
}
/*
* Unofficial Cocoa method for debugging a view hierarchy.
*/
- (NSString*) _subtreeDescription
{
return [self _subtreeDescriptionWithPrefix: @""];
}
/*
* Class methods
*/