All pastes #2066107 Raw Edit

Stuff

public text v1 · immutable
#2066107 ·published 2011-05-21 04:16 UTC
rendered paste body
#import <Cocoa/Cocoa.h>
#import <stdio.h>
int main() {
        // Allows appkit objects to be used
        NSApplicationLoad();
        // This allows us to manage memory
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        /* This creates a window object
         * It is 100 x 30 pixels and has its origin at 40, 40
         * It has a title bar, can be closed and resizable
         * and it is not deferred
        */
        NSWindow *window = [[NSWindow alloc] initWithContentRect: NSMakeRect(40.0, 40.0, 100.0, 30.0)
                        styleMask: ( NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask )
                        backing: NSBackingStoreBuffered
                        defer: NO];
        // This displays the window to the screen
        [window makeKeyAndOrderFront: nil];
        getchar();
        [window release];
        [pool release];
        return 0;
}