• 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: Setting NSColorPanel to affect NSBackgroundColorAttributeName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting NSColorPanel to affect NSBackgroundColorAttributeName


  • Subject: Re: Setting NSColorPanel to affect NSBackgroundColorAttributeName
  • From: Keith Blount <email@hidden>
  • Date: Tue, 18 Dec 2007 14:49:11 -0800 (PST)

Thanks yet again, Martin. Your suggestion was indeed the best way to go. My main issue was that I had I have several text views that could be affected, so I ended up just creating an NSTextView category with a class setter and getter for the color panel mode (background or foreground colour). Along with your suggestion, this works well.


Thanks again!
Keith

----- Original Message ----
From: Martin Wierschin <email@hidden>
To: Keith Blount <email@hidden>
Cc: CocoaDev (Apple) <email@hidden>
Sent: Friday, December 14, 2007 2:24:11 AM
Subject: Re: Setting NSColorPanel to affect NSBackgroundColorAttributeName


> So, when you select Format > Font > Show Colors, which you would
> expect to affect the foreground colour as it does in TextEdit, it
> will now affect the background colour if the background colour
> button has been used.

Can't you just have the action method for your Show Colors menu reset
your color targeting state? Just replace the default action with one
that clears your flag and then calls the default color panel method.

In our application we have other complications that required
overriding private NSColorPanel methods that work in tandem with some
custom subclasses. It's pretty messy and hopefully you don't need to
go that route.

~Martin






      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

_______________________________________________

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

  • Prev by Date: Re: Learning xcode/ibuilder ... newb questions
  • Next by Date: Re: Gluing two images together question...
  • Previous by thread: Re: Setting NSColorPanel to affect NSBackgroundColorAttributeName
  • Next by thread: Weird Apple Sample code
  • Index(es):
    • Date
    • Thread