libui/redo/osxaltest/main.m

50 lines
928 B
Mathematica
Raw Normal View History

// 31 july 2015
#import "osxaltest.h"
// #qo LDFLAGS: -framework Foundation -framework AppKit
2015-08-01 14:44:06 -05:00
BOOL margined = NO;
@interface appDelegate : NSObject<NSApplicationDelegate>
@end
@implementation appDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)note
{
tWindow *mainwin;
tButton *button;
tSpinbox *spinbox;
mainwin = [[tWindow alloc] init];
2015-08-01 14:44:06 -05:00
[mainwin tSetMargined:margined];
// button = [[tButton alloc] tInitWithText:@"Button"];
// [mainwin tSetControl:button];
spinbox = [[tSpinbox alloc] init];
[mainwin tSetControl:spinbox];
[mainwin tShow];
}
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)a
{
return YES;
}
@end
int main(int argc, char *argv[])
{
NSApplication *app;
2015-08-01 14:44:06 -05:00
margined = argc > 1;
app = [NSApplication sharedApplication];
[app setActivationPolicy:NSApplicationActivationPolicyRegular];
[app setDelegate:[appDelegate new]];
[app run];
return 0;
}