Moved tBox out of the way. We'll start with just a tButton for now.

This commit is contained in:
Pietro Gagliardi 2015-08-01 15:08:33 -04:00
parent 63439daffc
commit cdbf2d5b5c
2 changed files with 9 additions and 4 deletions

View File

@ -20,17 +20,20 @@
- (void)tAddControl:(id<tControl>)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<tControl> c;
vv = (NSView *) obj;
[v addSubview:vv];
c = (id<tControl>) obj;
[c tAddToView:self->sv];
}];
}

View File

@ -13,10 +13,12 @@
- (void)tRelayout;
@end
/*
@interface tBox : NSObject<tControl>
- (id)tInitVertical:(BOOL)vert;
- (void)tAddControl:(id<tControl>)c stretchy:(BOOL)s;
@end
*/
@interface tButton : NSObject<tControl>
- (id)tInitWithText:(NSString *)text;