Hi all, I am new to cocoa and objective C.
I am looking for a way to handle events for a NSView created programmatically (without IB). Is it possible starting from the following code? - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application // [[NSColor yellowColor] set]; NSView *superView = [window contentView]; // [NSBezierPath fillRect:[superView bounds]]; NSRect frame = NSMakeRect(50, 50, 200, 100); NSView *myView = [[NSView alloc] initWithFrame:frame]; [superView addSubview:myView]; [[NSColor greenColor] set]; [NSBezierPath fillRect:[myView bounds]]; [myView setTarget:self] // [myView setNeedsDisplay:YES]; [myView release]; } Thanks Luca _______________________________________________ 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 arch...@mail-archive.com