• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSColorWell question (NSColorPanel)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSColorWell question (From: Aaron Boothello <email@hidden>)
 >Re: NSColorWell question (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: remote proxy object somehow not correct
  • Next by Date: Re: setKeys + array operators = slowdown
  • Previous by thread: Re: NSColorWell question
  • Next by thread: Drawing on top of a QuickTime movie?
  • Index(es):
    • Date
    • Thread