Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // main.m!!!
- #import <Cocoa/Cocoa.h>
- #import <Foundation/Foundation.h>
- int main(int argc, char *argv[])
- {
- NSRect windowRect = NSMakeRect(10.0f, 10.0f, 800.0f, 600.0f);
- NSWindow *window = [[NSWindow alloc] initWithContentRect:windowRect
- styleMask:( NSResizableWindowMask | NSClosableWindowMask | NSTitledWindowMask)
- backing:NSBackingStoreBuffered defer:NO];
- [window makeKeyAndOrderFront:nil];
- [[window frame ]
- // NSPoint x = (window.screen.frame.size.width - window.size.width) / 2;
- // NSPoint y = (window.screen.frame.size.height - window.size.height) / 2;
- // Create a rect to send to the window
- // NSRect newFrame = NSMakeRect(x, y, window.size.width, window.size.height);
- // Send message to the window to resize/relocate
- // [window setFrame:windowRect display:YES animate:NO];
- [window setTitle:@"Youssef Gamil"];
- return NSApplicationMain(argc, (const char **) argv);
- }
Advertisement
Add Comment
Please, Sign In to add comment