Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField/Cell + selection color?



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >NSTextField/Cell + selection color? (From: Brian Amerige <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.