Moved tBox out of the way. We'll start with just a tButton for now.
This commit is contained in:
parent
63439daffc
commit
cdbf2d5b5c
|
@ -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];
|
||||
}];
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue