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

Re: NSColorPanel flat out lies


  • Subject: Re: NSColorPanel flat out lies
  • From: Alexander Heinz <email@hidden>
  • Date: Tue, 26 May 2009 20:58:01 -0400

I'm sorry, I misread; you're talking about NSColorPanel.

You might try sending setContinous:NO to the color panel.

Hope that helps,
Alex Heinz

On May 26, 2009, at 8:54 PM, Alexander Heinz wrote:

NSColorWell is a subclass of NSControl. It should respond to setTarget:. Just use that.

HTH,
Alex Heinz

On May 26, 2009, at 8:11 PM, Seth Willits wrote:


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


References: 
 >NSColorPanel flat out lies (From: Seth Willits <email@hidden>)
 >Re: NSColorPanel flat out lies (From: Alexander Heinz <email@hidden>)

  • Prev by Date: Re: NSColorPanel flat out lies
  • Next by Date: Re: NSColorPanel flat out lies
  • Previous by thread: Re: NSColorPanel flat out lies
  • Next by thread: Re: NSColorPanel flat out lies
  • Index(es):
    • Date
    • Thread