Thanks to those folks who have tried (unsuccessfully) to help me. My first post clearly contained too many magenta mackerels, so I've done what I should have started with and reduced it to a shorter example.

Given the following complete, nibless, and astoundingly uninteresting app:

#import <Cocoa/Cocoa.h>

int main(int argc, char *argv[])
{
//    return NSApplicationMain(argc,  (const char **) argv);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];

NSRect platRect;
platRect.origin.x = 300;
platRect.origin.y = 300;
platRect.size.width = 200;
platRect.size.height = 200;

NSWindow* aWindow = [[NSWindow alloc] initWithContentRect:platRect
styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask) backing:NSBackingStoreRetained defer:YES];


platRect.origin.x = 20;
platRect.origin.y = 20;
platRect.size.width = 100;
platRect.size.height = 100;

NSControl* ctl = [[NSButton alloc] init];
[(NSButton*)ctl setButtonType:NSSwitchButton];
[(NSButton*)ctl setTitle:@"Check Me"];
[(NSButton*)ctl setState:1];
[ctl setFrame:platRect];

NSView* cview = [aWindow contentView];
[cview addSubview:ctl];

[aWindow makeKeyAndOrderFront:nil];

[NSApp run];

return 0;
}

Clearly I'm missing something critical here (and "artistic talent" isn't what I'm looking for). What important step am I missing to make the event loop handle the drawing of my window and checkbox?

--Christopher Kempke
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to