diff --git a/redo/osxaltest/box.m b/redo/osxaltest/box.m index 40a80920..3a6c7520 100644 --- a/redo/osxaltest/box.m +++ b/redo/osxaltest/box.m @@ -25,6 +25,7 @@ BOOL spaced; } +// TODO rename to padded - (id)tInitVertical:(BOOL)vert spaced:(BOOL)sp { self = [super init]; diff --git a/redo/osxaltest/window.m b/redo/osxaltest/window.m index 196f1058..89c9b763 100644 --- a/redo/osxaltest/window.m +++ b/redo/osxaltest/window.m @@ -1,6 +1,24 @@ // 1 august 2015 #include "osxaltest.h" +@implementation NSView (AutoLayoutHelpers) +- (void)tIsAmbiguous:(uintmax_t)indent +{ + NSMutableString *s; + uintmax_t i; + NSUInteger j; + + s = [NSMutableString new]; + for (i = 0; i < indent; i++) + [s appendString:@" "]; + NSLog(@"%@%@ %d", s, [self className], (int) [self hasAmbiguousLayout]); + if ([self hasAmbiguousLayout]) + [[self window] visualizeConstraints:[[self superview] constraints]]; + for (j = 0; j < [[self subviews] count]; j++) + [[[self subviews] objectAtIndex:j] tIsAmbiguous:(indent + 1)]; +} +@end + @implementation tWindow { NSWindow *w; id c; @@ -37,6 +55,7 @@ { [self->w cascadeTopLeftFromPoint:NSMakePoint(20, 20)]; [self->w makeKeyAndOrderFront:self]; + [[self->w contentView] tIsAmbiguous:0]; } - (void)tRelayout