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

NSColorPanel flat out lies


  • Subject: NSColorPanel flat out lies
  • From: Seth Willits <email@hidden>
  • Date: Tue, 26 May 2009 17:11:28 -0700


I have a color well, which I am clicking on, and whenever I change the color in the color panel, the color panel sends a changeColor: message down the responder chain. Every time.


I *don't* want this, because it's sending changeColor to the wrong object. It's a bit long-winded to explain, but it boils down to the fact that I have this color well bound to a color property in a model object and I don't want any actions sent.

So I read the docs:

"When you select a color in the color panel, NSColorPanel sends its action to its target, provided that neither the action nor the target is nil."


Ok, so I figured the color panel must have changeColor: set as its action. I went to inspect what it was set to but... YOU CAN'T. There is no -target or -action method in NSColorPanel. *lovely*. So I tried setting both to nil in my controller, and tried it again... Same deal. changeColor: is being called.


So I figured it must be the color well which is setting the action when the color well becomes active. So I created a custom color well subclass, and did:

- (void)activate:(BOOL)exclusive;
{
	[super activate:exclusive];
	[[NSColorPanel sharedColorPanel] setTarget:nil];
	[[NSColorPanel sharedColorPanel] setAction:nil];
}


... which should hopefully fix the problem. It doesn't. changeColor: is *STILL* called.


What the heck do I have to do to make it NOT send an action message?


-- Seth Willits



_______________________________________________

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


  • Follow-Ups:
    • Re: NSColorPanel flat out lies
      • From: Cathy Shive <email@hidden>
    • Re: NSColorPanel flat out lies
      • From: Graham Cox <email@hidden>
    • Re: NSColorPanel flat out lies
      • From: Alexander Heinz <email@hidden>
  • Prev by Date: Re: Recommendations to Reading the Xcode in built Documentation to the fullest effect
  • Next by Date: Re: NSColorPanel flat out lies
  • Previous by thread: Re: Reading an AliasHandle from a Finder alias file
  • Next by thread: Re: NSColorPanel flat out lies
  • Index(es):
    • Date
    • Thread