Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
change NSView background color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

change NSView background color

I have the following code:
- (void)drawRect:(NSRect)rect
   rect = [self bounds];
   [NSColor blueColor] set];
   [NSBezierPath fillRect: rect];

- (void) changeColor: (NSColor *)c
   [[NSColor blackColor] set];
   [NSBezierPath fillRect: [self bounds]];

with the drawRect method,  I get to have the NSView in blue color.
However,  I would like to change the color with an action so I created
changeColor method.  But I cant get it to change the color.  What am I
missing?  thnaks

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

Visit the Apple Store online or at retail locations.

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.