• 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: NSTextField/Cell + selection color?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField/Cell + selection color?


  • Subject: Re: NSTextField/Cell + selection color?
  • From: "Alan Smith" <email@hidden>
  • Date: Sun, 29 Apr 2007 16:03:17 -0400

Hi Brian,

Below is a message I sent to someone who had asked the same question
but for NSTextView. It's a "hack" and will change the selection color
app-wide.


Assuming you want to change the default selection color, subclass NSColor and override the method that is something like - (NSColor*)selectedTextColor;

Then you'll have to make your subclass poseAsClass: [NSColor class].
You can either do that in main.m or directly in your subclass like so:

+ (void)load
{
[self poseAsClass: [NSColor class]];
// Or even like this:
// [self poseAsClass: [super class]];
// That part is up to you, which is more "cocoa like" I don't know.
}

Have fun!
Peace, Alan


-- // Quotes from yours truly ------------------------- "You don't forget, you just don't remember." "Maturity resides in the mind." "Silence is the Universe's greatest gift." "When the World realizes that religion really is unnecessary, then it shall evolve." _______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >NSTextField/Cell + selection color? (From: Brian Amerige <email@hidden>)

  • Prev by Date: Re: NSTask vs. special characters
  • Next by Date: bindings, nested arrays and validation
  • Previous by thread: NSTextField/Cell + selection color?
  • Next by thread: retain recursively applied to objects?
  • Index(es):
    • Date
    • Thread