• 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 / NSColorPanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSColorWell / NSColorPanel


  • Subject: Re: NSColorWell / NSColorPanel
  • From: koko <email@hidden>
  • Date: Sat, 04 Feb 2012 10:09:25 -0700

That is what I ended up doing and all is well.  Thanks, Graham for confirming what I found to be the behavior.

-koko

On Feb 3, 2012, at 10:18 PM, Graham Cox wrote:

>
> On 04/02/2012, at 11:08 AM, koko wrote:
>
>> In a modal panel I have a NSColorWell.  Clicking the NSColorWell display a NSColorPanel.
>>
>> The NSColorPanel docs say that the method -(void)changeColor:(id)sender is sent to the first responder and that you can override this method in any responder that needs to respond to a color change.
>>
>> I have implemented this method in the class that is the file's owner for the modal panel which is a NSWindowController.
>>
>> The method -(void)changeColor:(id)sender is not called on a color change in the NSColorPanel.
>>
>> How do I get the method -(void)changeColor:(id)sender called.
>
>
>
> Not that way, actually.
>
> Since you have a colorwell, the colorwell will be hooked up to the color panel as long as it is selected. So just set the colorwell control's target and action to the desired handler and you will get the change. This is more reliable than relying on the color panel sending to the responder chain - I THINK it only does that when it doesn't have a specific colorwell to talk to (if it did, you'd likely get mutliple colour changes in unrelated parts of the app). The mechanism you describe is mostly useful when the key view can respond to a colour change as a whole.
>
> --Graham
>
>
>


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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 / NSColorPanel (From: koko <email@hidden>)
 >Re: NSColorWell / NSColorPanel (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Recently Opened in Doc
  • Next by Date: Magnify Glass Color Picker
  • Previous by thread: Re: NSColorWell / NSColorPanel
  • Next by thread: Loading Typeface from NSBundle
  • Index(es):
    • Date
    • Thread