• 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, changeColor: and first responder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSColorWell, changeColor: and first responder


  • Subject: Re: NSColorWell, changeColor: and first responder
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 11 Aug 2003 12:12:39 -0700

On Monday, August 11, 2003, at 11:38 AM, Drew McCormack wrote:

I have a window with a NSColorWell and a NSTextView, which are basically unrelated. I want to use the color well to set a color in my model object. This works fine.

Problem is, if I click the well, I get a NSColorPanel, and if I leave this open and then start editing the NSTextView, the text changes color based on the selected color in the NSColorPanel.

It seems NSColorPanel sends a changeColor: message to the first responder when a color is selected. This is not the behavior I want though, in this case.

What is the best way to prevent this? Can I make the NSTextView not display colors? Can I get the NSColorPanel not to send the message? Is there an elegant solution short of an ugly subclass?

You can subclass NSTextView and arrange for it not to respond to changeColor: when your color well is active. There are other solutions, but this seems the most obvious.

Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSColorWell, changeColor: and first responder (From: Drew McCormack <email@hidden>)

  • Prev by Date: Re: GCC3?
  • Next by Date: Re: Looking for clarification on Applescript event handlers
  • Previous by thread: NSColorWell, changeColor: and first responder
  • Next by thread: Single-User Database
  • Index(es):
    • Date
    • Thread