diff --git a/redo/osxaltest/main.m b/redo/osxaltest/main.m index 49c5e6a5..3b45119f 100644 --- a/redo/osxaltest/main.m +++ b/redo/osxaltest/main.m @@ -10,20 +10,15 @@ - (void)applicationDidFinishLaunching:(NSNotification *)note { - NSWindow *mainwin; - tWindowDelegate *delegate; + tWindow *mainwin; + tButton *button; - mainwin = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 320, 240) - styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask) - backing:NSBackingStoreBuffered - defer:YES]; - [mainwin setTitle:@"Auto Layout Test"]; + mainwin = [[tWindow alloc] init]; - delegate = [tWindowDelegate new]; - [mainwin setDelegate:delegate]; + button = [[tButton alloc] tInitWithText:@"Button"]; + [mainwin tSetControl:button]; - [mainwin cascadeTopLeftFromPoint:NSMakePoint(20, 20)]; - [mainwin makeKeyAndOrderFront:self]; + [mainwin tShow]; } - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)a diff --git a/redo/osxaltest/osxaltest.h b/redo/osxaltest/osxaltest.h index 6559cbc9..9fdd9fda 100644 --- a/redo/osxaltest/osxaltest.h +++ b/redo/osxaltest/osxaltest.h @@ -8,8 +8,10 @@ - (uintmax_t)tAddToAutoLayoutDictionary:(NSMutableDictionary *)views keyNumber:(uintmax_t)n; @end -@interface tWindowDelegate : NSObject +@interface tWindow : NSObject - (void)tSetControl:(id)cc; +- (void)tShow; +// TODO this should probably in tControl - (void)tRelayout; @end diff --git a/redo/osxaltest/windelegate.m b/redo/osxaltest/windelegate.m deleted file mode 100644 index 2df0b668..00000000 --- a/redo/osxaltest/windelegate.m +++ /dev/null @@ -1,28 +0,0 @@ -// 1 august 2015 -#import "osxaltest.h" - -@implementation tWindowDelegate { - id c; -} - -- (id)init -{ - self = [super init]; - if (self) - self->c = NULL; - return self; -} - -- (void)tSetControl:(id)cc -{ - self->c = cc; -} - -- (void)tRelayout -{ - if (self->c == NULL) - return; - // TODO -} - -@end