Some cleanup in the Auto Layout test.

This commit is contained in:
Pietro Gagliardi 2015-08-01 14:22:45 -04:00
parent c9da21e350
commit 63439daffc
5 changed files with 17 additions and 14 deletions

View File

@ -1,16 +1,13 @@
// 31 july 2015 // 31 july 2015
#import "osxaltest.h" #import "osxaltest.h"
@interface tBox : NSObject<tControl> { @implementation tBox {
NSMutableArray *children; NSMutableArray *children;
NSView *sv; NSView *sv;
BOOL vertical; BOOL vertical;
} }
@end
@implementation tBox - (id)tInitVertical:(BOOL)vert
- (id)initVertical:(BOOL)vert
{ {
self = [super init]; self = [super init];
if (self) { if (self) {
@ -21,7 +18,7 @@
return self; return self;
} }
- (void)addControl:(NSObject<tControl> *)c stretchy:(BOOL)s - (void)tAddControl:(id<tControl>)c stretchy:(BOOL)s
{ {
// TODO // TODO
} }

View File

@ -1,14 +1,11 @@
// 31 july 2015 // 31 july 2015
#import "osxaltest.h" #import "osxaltest.h"
@interface tButton : NSObject<tControl> { @implementation tButton {
NSButton *b; NSButton *b;
} }
@end
@implementation tButton - (id)tInitWithText:(NSString *)text
- (id)initWithText:(NSString *)text
{ {
self = [super init]; self = [super init];
if (self) { if (self) {

Binary file not shown.

View File

@ -9,8 +9,17 @@
@end @end
@interface tWindowDelegate : NSObject<NSWindowDelegate> @interface tWindowDelegate : NSObject<NSWindowDelegate>
- (void)tSetControl:(NSObject<tControl> *)cc; - (void)tSetControl:(id<tControl>)cc;
- (void)tRelayout; - (void)tRelayout;
@end @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;
@end
extern NSString *tAutoLayoutKey(uintmax_t); extern NSString *tAutoLayoutKey(uintmax_t);

View File

@ -2,7 +2,7 @@
#import "osxaltest.h" #import "osxaltest.h"
@implementation tWindowDelegate { @implementation tWindowDelegate {
NSObject<tControl> *c; id<tControl> c;
} }
- (id)init - (id)init
@ -13,7 +13,7 @@
return self; return self;
} }
- (void)tSetControl:(NSObject<tControl> *)cc - (void)tSetControl:(id<tControl>)cc
{ {
self->c = cc; self->c = cc;
} }