Re: NSColorWell question (NSColorPanel)
Re: NSColorWell question (NSColorPanel)
- Subject: Re: NSColorWell question (NSColorPanel)
- From: Aaron Boothello <email@hidden>
- Date: Tue, 16 Jan 2007 13:56:02 +0800
Thanks for that.
Been reading up on responders, and the first responder in particular.
this is my introduction to responders, so i still havent figured it out.
so here's what im doing thus far:
//----------------------------------------------------------------------
-------------------------
//action method (in my NSView subclass) when user selects menu item
to change color
-(IBAction) changeBackgroundColor:(id)sender
{
[[NSColorPanel sharedColorPanel] makeKeyAndOrderFront:self];
[[self window] makeFirstResponder:self];
}
//overridden the responder methods
-(BOOL)acceptsFirstResponder
{
return YES;
}
- (BOOL)becomeFirstResponder
{
return YES;
}
- (BOOL)resignFirstResponder
{
return YES;
}
//overridden the changeColor NSColorPanelResponder method
- (void)changeColor:(id)sender
{
NSColor *c = [[sender color]
colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
[self setNeedsDisplay:YES];
}
//----------------------------------------------------------------------
-------------------------
So when the sharedColorPanel comes up, and i select different
colors.... nothing happens. what am i doing wrong ?
Cheers,
Aaron
On 15/01/2007, at 9:20 PM, Andreas Mayer wrote:
Am 15.01.2007 um 13:53 Uhr schrieb Aaron Boothello:
Can it be done ? how ?
http://developer.apple.com/documentation/Cocoa/Conceptual/DrawColor/
Tasks/ChoosingColors.html
Andreas
_______________________________________________
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)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
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)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden