From cdbf2d5b5c524eae74d5a3ae556b0c0439d8b241 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 1 Aug 2015 15:08:33 -0400 Subject: [PATCH] Moved tBox out of the way. We'll start with just a tButton for now. --- redo/osxaltest/{box.m => box.m_} | 11 +++++++---- redo/osxaltest/osxaltest.h | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) rename redo/osxaltest/{box.m => box.m_} (89%) diff --git a/redo/osxaltest/box.m b/redo/osxaltest/box.m_ similarity index 89% rename from redo/osxaltest/box.m rename to redo/osxaltest/box.m_ index e9f2a3c2..7021e83a 100644 --- a/redo/osxaltest/box.m +++ b/redo/osxaltest/box.m_ @@ -20,17 +20,20 @@ - (void)tAddControl:(id)c stretchy:(BOOL)s { - // TODO + if (self->sv != nil) + [c tAddToView:self->sv]; + [self->children addObject:c]; + // TODO mark as needing relayout } - (void)tAddToView:(NSView *)v { self->sv = v; [self->children enumerateObjectsUsingBlock:^(id obj, NSUInteger index, BOOL *stop) { - NSView *vv; + id c; - vv = (NSView *) obj; - [v addSubview:vv]; + c = (id) obj; + [c tAddToView:self->sv]; }]; } diff --git a/redo/osxaltest/osxaltest.h b/redo/osxaltest/osxaltest.h index e7ddb038..6559cbc9 100644 --- a/redo/osxaltest/osxaltest.h +++ b/redo/osxaltest/osxaltest.h @@ -13,10 +13,12 @@ - (void)tRelayout; @end +/* @interface tBox : NSObject - (id)tInitVertical:(BOOL)vert; - (void)tAddControl:(id)c stretchy:(BOOL)s; @end +*/ @interface tButton : NSObject - (id)tInitWithText:(NSString *)text;