mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 18:50:38 +00:00
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:
parent
8924d931c0
commit
46bba406d0
3 changed files with 42 additions and 0 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue