Attributed String Backgrounds
Attributed String Backgrounds
- Subject: Attributed String Backgrounds
- From: "W. W. Gilpin" <email@hidden>
- Date: Mon, 19 Dec 2005 23:57:04 -0600
I have an NSTableView with several hundred rows, and about 30 columns.
The dataCell for most of these columns is a subclass of
NSTextFieldCell. Each of these cells can contain several individual
lines of right-aligned attributed text. (Up to 8 lines, depending on
user settings and object value contents). In my subclass, I am
aggregating these lines into a single attributed string and drawing.
Each line of this attributed string may have a background color
attribute set. For those that do, I would like to have the background
color painted on that line for the entire width of the cell, not just
behind the glyphs of the strings. (e.g. the portion to the left of
the right-aligned text)
For the second, and subsequent lines I can just let the attributes
for the line include the newline character, and the next line is
painted with the background color all the way across the width of the
cell frame.
However, I do not see an obvious way to get the first line to do
this. Is there a way to convince the attributed string to draw like
this, or do I need to draw the line's background manually, or draw
each line separately with another NSCell?
Suggestions?
W. W. Gilpin
email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden