advertisement

Article:
  Creating a Color Meter Using Cocoa
Subject:   Color Meter compiling problems
Date:   2003-07-06 10:59:27
From:   anonymous2
This code won´t compile 15 errors can anyone help?
e78marcelo@hotmail.com
#import <Cocoa/Cocoa.h>


@interface Controller : NSObject
{
IBOutlet id alphaField;
IBOutlet id alphaSlider;
IBOutlet id blueField;
IBOutlet id blueSlider;
IBOutlet id colorWell;
IBOutlet id greenField;
IBOutlet id greenSlider;
IBOutlet id redField;
IBOutlet id redSlider;
float redValue;
float greenValue;
float blueValue;
float alphaValue;
}
- (IBAction)setAlpha:(id)sender;
{
alphaValue = [ sender floatValue];
[alphaField setFloatValue:alphaValue];
[alphaSlider setFloatValue:alphaValue];
[self updateColor];
}
- (IBAction)setBlue:(id)sender
{
blueValue = [sender floatValue];
[blueField setFloatValue:blueValue];
[blueSlider setFloatValue:blueValue];
[self updateColor];
}
- (IBAction)setGreen:(id)sender
{
greenValue = [sender floatValue];
[greenField setFloatValue:greenValue];
[greenSlider setFloatValue:greenValue];
[ self updateColor];
}
- (IBAction)setRed:(id)sender
{
redValue = [sender floatValue];
[redField setFloatValue:redValue];
[redSlider setFloatValue:redValue];
[ self updateColor];
}
- (void)updateColor
{
NSColor *aColor = [ NSColor colorWithCalibratedRed:redValue green:greenValue blue:blueValue alpha:alphaValue];
[colorWell setColor:aColor];
}
@end