I am trying to have the color change on an custom view, as created in the below code.
myColor is set to the NSColorWell. Basically in the IB there is a color well and a custom view. The custom view starts with green, and I want it to change with changes in the color well.
Appreciate any help.
Adam
Code:
#import "myView.h"
@implementation myView
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
}
return self;
}
- (void)drawRect:(NSRect)rect {
myBounds=[self bounds];
[[NSColor greenColor]set];
NSRectFill(myBounds);
}
-(void)resetColor
{
[[myColor color]set];
NSRectFill(myBounds);
[self setNeedsDisplay:YES];
}
@end
myColor is set to the NSColorWell. Basically in the IB there is a color well and a custom view. The custom view starts with green, and I want it to change with changes in the color well.
Appreciate any help.
Adam