Re: Attributed strings in NSTableViews
Please do file radars about this. Apple only knows how many people are affected if they let them know. --Kyle Sluder On Jun 30, 2013, at 1:01 PM, Peter Hudson <peter.hudson@me.com> wrote:
Andy
Thanks for this, It helps me fix another problem I have.
Peter
On 30 Jun 2013, at 20:48, Andy Lee <aglee@mac.com> wrote:
On Jun 30, 2013, at 2:44 PM, Kyle Sluder <kyle@ksluder.com> wrote:
On Jun 30, 2013, at 6:04 AM, Peter Hudson <peter.hudson@me.com> wrote:
I then append a second attributed string to the first - with very similar attributes as the first. After this, when the row is selected, the system no longer reverses out the text color as it did previously.
Text drawing will only reverse the colors of text if the entire string is drawn in NSControlTextColor. (I've filed a Radar on this opaque, undocumented, uncustomizable behavior.)
I ran into similar stubbornness when trying to use a custom color for the title of an NSButton when it is disabled. My workaround, based on an answer I found on StackOverflow, was to override the cell's drawTitle:withFrame:inView: method.
.m: <https://github.com/aglee/appkido/blob/master/src/CustomViews/AKButtonCell.m>
.h: <https://github.com/aglee/appkido/blob/master/src/CustomViews/AKButtonCell.h>
Maybe the same technique would work for you. You'd have to figure out how to reverse the color yourself, but at least you'd have complete control over the string's appearance.
--Andy
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Kyle Sluder