Re: Trimming text in a tableview
Re: Trimming text in a tableview
- Subject: Re: Trimming text in a tableview
- From: "Clark S. Cox III" <email@hidden>
- Date: Thu, 5 Jun 2003 09:46:28 -0400
On Thursday, Jun 5, 2003, at 09:03 US/Eastern, Obi One wrote:
Hi,
I'm searching a way to have "trimmed" or "truncated"
text (it's maybe not the right words)in my tableview
cells.
I would like to have the same trimmed text like Safari
has in the bookmark lists. When the text is too long,
after resizing the column for example, the displayed
string is something like "hello...you ?", with "..."
in its middle.
I think the solution is simple but i really don't know
where to search :)
If I were trying to do this, I'd probably make a custom subclass of
NSTextFieldCell that draws using the behavior you describe (i.e. check
the strings width against the cell's width, take out some characters in
the middle, repeat until the string fits.), and use that as the
dataCell of my table columns.
--
http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.