Crash while getting the NSColor components
Crash while getting the NSColor components
- Subject: Crash while getting the NSColor components
- From: Vinay Prabhu <email@hidden>
- Date: Tue, 20 Jun 2006 14:09:48 +0530 (IST)
Hi,
I am facing a weird crash with the NSColor,
My application consistently crashes while obtaining the color
components in the following line,
[colorOfPanelSolid getRed:&red green:&green blue:&blue
alpha:&alpha];
Control enters into the following method when scroll wheel is
used to scroll. If scroll wheel is moved slowly, like one
click at a time it doesn't crash. If the scroll wheel is
moved rapidly, it crashes!!!
The NSLog is entry is "NSCalibratedRGBColorSpace".
The code is as follows,
-(void)drawPreview:(NSRect)rect
graphContext:(CGContextRef)context
{
float red = 0, green = 0, blue = 0, alpha = 0;
CGRect rect1 = CGRectMake (rect.origin.x, rect.origin.y,
rect.size.width, rect.size.height);
if(flag)
{
NSString* name = [colorOfPanelSolid colorSpaceName];
NSLog(name);
[colorOfPanelSolid getRed:&red green:&green blue:&blue
alpha:&alpha];
CGContextSetRGBFillColor(context, red, green, blue, alpha);
CGContextFillRect(context, rect1);
}
else if(!flag)
{
[self drawGradPreview:rect];
}
else
{
CGContextSetRGBFillColor(context, 1, 1, 1, 1);
CGContextFillRect(context, rect1);
}
}
Regards
Vinay
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s)and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender or email@hidden
_______________________________________________
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