From f7c5c6e60e980bd70bb2208802716c46b0b2efe8 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 3 Aug 2015 12:16:08 -0400 Subject: [PATCH] More ambiguity debugging hooks. --- redo/osxaltest/box.m | 2 ++ redo/osxaltest/main.m | 12 ++++++------ redo/osxaltest/window.m | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/redo/osxaltest/box.m b/redo/osxaltest/box.m index b4564874..c74ec794 100644 --- a/redo/osxaltest/box.m +++ b/redo/osxaltest/box.m @@ -120,6 +120,7 @@ [constraint appendString:@"]"]; } [constraint appendString:@"|"]; +NSLog(@"%@", constraint); [self->v addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:constraint options:0 metrics:nil views:views]]; // TODO do not release constraint; it's autoreleased? @@ -131,6 +132,7 @@ constraint = [NSMutableString stringWithString:@"V:|["]; [constraint appendString:tAutoLayoutKey(i)]; [constraint appendString:@"]|"]; +NSLog(@"%@", constraint); [self->v addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:constraint options:0 metrics:nil views:views]]; // TODO do not release constraint; it's autoreleased? } diff --git a/redo/osxaltest/main.m b/redo/osxaltest/main.m index 0d899a90..84beda29 100644 --- a/redo/osxaltest/main.m +++ b/redo/osxaltest/main.m @@ -24,11 +24,11 @@ BOOL firstvert = YES; box = [[tBox alloc] tInitVertical:firstvert spaced:spaced]; - spinbox = [[tSpinbox alloc] init]; +/* spinbox = [[tSpinbox alloc] init]; [box tAddControl:spinbox stretchy:NO]; - +*/ [mainwin tSetControl:box]; - +/* hbox = [[tBox alloc] tInitVertical:!firstvert spaced:spaced]; button = [[tButton alloc] tInitWithText:@"Button"]; [hbox tAddControl:button stretchy:YES]; @@ -53,7 +53,7 @@ BOOL firstvert = YES; button = [[tButton alloc] tInitWithText:@"CCC"]; [hbox tAddControl:button stretchy:NO]; [box tAddControl:hbox stretchy:NO]; - +*/ // TODO this isn't stretchy in the proper order hbox = [[tBox alloc] tInitVertical:!firstvert spaced:spaced]; spinbox = [[tSpinbox alloc] init]; @@ -61,14 +61,14 @@ BOOL firstvert = YES; spinbox = [[tSpinbox alloc] init]; [hbox tAddControl:spinbox stretchy:YES]; [box tAddControl:hbox stretchy:NO]; - +/* hbox = [[tBox alloc] tInitVertical:!firstvert spaced:spaced]; entry = [[tEntry alloc] init]; [hbox tAddControl:entry stretchy:NO]; entry = [[tEntry alloc] init]; [hbox tAddControl:entry stretchy:YES]; [box tAddControl:hbox stretchy:NO]; - +*/ [mainwin tShow]; } diff --git a/redo/osxaltest/window.m b/redo/osxaltest/window.m index 89c9b763..39d65635 100644 --- a/redo/osxaltest/window.m +++ b/redo/osxaltest/window.m @@ -12,8 +12,8 @@ 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]]; +// if ([self hasAmbiguousLayout]) +// [[self window] visualizeConstraints:[self constraints]]; for (j = 0; j < [[self subviews] count]; j++) [[[self subviews] objectAtIndex:j] tIsAmbiguous:(indent + 1)]; }