Changing color in NSColorWell
Changing color in NSColorWell
- Subject: Changing color in NSColorWell
- From: R T <email@hidden>
- Date: Wed, 11 Oct 2006 20:14:31 -0700 (PDT)
In the "DrawerController" files below, the code...
float aRed = .7581, aGre = 1., aBlu = 0, aAlp = 1;
[chosenColorWell setColor:[NSColor
colorWithCalibratedRed:aRed green:aGre blue:aBlu
alpha:aAlp]];
...works correctly. It Changes the color in a
ColorWell.
In the "Space" files also below the same code does not
work.
Any ideas Why?
The ColorWells were both created in IB and then set up
as outlets and connected.
Thanks Rick T.
//////////////////////////
#import <Cocoa/Cocoa.h>
@interface DrawerController : NSObject
{
IBOutlet NSColorWell *aChosenColorWell;
}
- (float)processLeftDrawer;
@end
//////////////////////////
#import "DrawerController.h"
@implementation DrawerController
- (float)processLeftDrawer{
float aRed = .7581, aGre = 1., aBlu = 0, aAlp = 1;
[aChosenColorWell setColor:[NSColor
colorWithCalibratedRed:aRed green:aGre blue:aBlu
alpha:aAlp]];
}
@end
//////////////////////////
/* Space */
#import <Cocoa/Cocoa.h>
@class DrawerController;
@interface Space : NSView
{
IBOutlet NSColorWell *anotherChosenColorWell;
}
- (void) mouseUp:(NSEvent *) theEvent;
@end
//////////////////////////
#import "Space.h"
#import "DrawerController.h"
@implementation Space
- (void) mouseUp:(NSEvent *) theEvent
{
float gPriRed = .7581, gPriGre = 1., gPriBlu = 0,
gPriAlp = 1;
[anotherChosenColorWell setColor:[NSColor
colorWithCalibratedRed:gPriRed green:gPriGre
blue:gPriBlu alpha:gPriAlp]];
}
@end
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden