From 1e66408881688d159cad979966ec25ee1e5e5ac8 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 3 Aug 2015 12:34:49 -0400 Subject: [PATCH] More debugging. It looks like I'll need to add that minimum width field after all. --- redo/osxaltest/box.m | 4 ++-- redo/osxaltest/spinbox.m | 4 ++++ redo/osxaltest/window.m | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/redo/osxaltest/box.m b/redo/osxaltest/box.m index 470748d2..cb3a0b8f 100644 --- a/redo/osxaltest/box.m +++ b/redo/osxaltest/box.m @@ -123,7 +123,7 @@ [constraint appendString:@"]"]; } [constraint appendString:@"|"]; -NSLog(@"%@", constraint); +NSLog(@"primary dimension %@", constraint); [self->v addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:constraint options:0 metrics:nil views:views]]; // TODO do not release constraint; it's autoreleased? @@ -135,7 +135,7 @@ NSLog(@"%@", constraint); constraint = [NSMutableString stringWithString:@"V:|["]; [constraint appendString:tAutoLayoutKey(i)]; [constraint appendString:@"]|"]; -NSLog(@"%@", constraint); +NSLog(@"other dimension %@", 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/spinbox.m b/redo/osxaltest/spinbox.m index 1e04d693..02f475d1 100644 --- a/redo/osxaltest/spinbox.m +++ b/redo/osxaltest/spinbox.m @@ -14,6 +14,8 @@ @end +int nspinbox = 0; + @implementation tSpinbox { tSpinboxContainer *c; NSTextField *t; @@ -33,6 +35,8 @@ [self->c setTranslatesAutoresizingMaskIntoConstraints:NO]; self->t = [[NSTextField alloc] initWithFrame:NSZeroRect]; +[self->t setStringValue:[NSString stringWithFormat:@"%d", nspinbox]]; +nspinbox++; [self->t setSelectable:YES]; [self->t setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]]]; [self->t setBordered:NO]; diff --git a/redo/osxaltest/window.m b/redo/osxaltest/window.m index 39d65635..8c0b08a2 100644 --- a/redo/osxaltest/window.m +++ b/redo/osxaltest/window.m @@ -12,9 +12,9 @@ for (i = 0; i < indent; i++) [s appendString:@" "]; NSLog(@"%@%@ %d", s, [self className], (int) [self hasAmbiguousLayout]); -// if ([self hasAmbiguousLayout]) -// [[self window] visualizeConstraints:[self constraints]]; - for (j = 0; j < [[self subviews] count]; j++) + if ([self hasAmbiguousLayout]) + [[self window] visualizeConstraints:[[self superview] constraints]]; +else for (j = 0; j < [[self subviews] count]; j++) [[[self subviews] objectAtIndex:j] tIsAmbiguous:(indent + 1)]; } @end