Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. //
  2. // main.m
  3. // test
  4. //
  5. // Created by George Watson on 25/06/2017.
  6. // Copyright © 2017 George Watson. All rights reserved.
  7. //
  8.  
  9. #import <Cocoa/Cocoa.h>
  10.  
  11. int main(int argc, const char * argv[]) {
  12. @autoreleasepool {
  13. NSUInteger windowStyle = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskResizable;
  14.  
  15. // Window bounds (x, y, width, height).
  16. NSRect windowRect = NSMakeRect(100, 100, 400, 400);
  17. NSWindow * window = [[NSWindow alloc] initWithContentRect:windowRect
  18. styleMask:windowStyle
  19. backing:NSBackingStoreBuffered
  20. defer:NO];
  21.  
  22. // Window controller:
  23. NSWindowController * windowController = [[NSWindowController alloc] initWithWindow:window];
  24.  
  25.  
  26. // TODO: Create app delegate to handle system events.
  27. // TODO: Create menus (especially Quit!)
  28.  
  29. // Show window and run event loop.
  30. [window orderFrontRegardless];
  31. [NSApp run];
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement