Re: tableView column ellipses
Re: tableView column ellipses
- Subject: Re: tableView column ellipses
- From: Evan Gross <email@hidden>
- Date: Thu, 20 Nov 2003 21:37:44 -0500
On 11/19/03 10:32 PM, "Kurt Marek" <email@hidden> wrote:
>
How do I get truncated text in a column of an NSTableView to show
>
ellipses when the column isn't wide enough to show the full text? For
>
an example of the behavior I want, see iTunes. Is this a simple setting
>
that I haven't located or is it done programmatically?
>
>
Kurt
>
It's not a simple setting at all (the --- alignment in IB has nothing to do
with truncating strings).
If you only need to do this on 10.3, you could use attributed strings with
one of the NSLineBreakByTruncating... paragraph styles (these don't work on
Jaguar).
If you need something that works on 10.2 and 10.3, you could try using some
source I posted to CocoaDev:
<
http://www.cocoadev.com/index.pl?BetterTruncatingStringsInTableView>
The latest version isn't up there, but you can download it from my web site
(it works around an ATSUI bug introduced in 10.3):
<
http://www.rainmakerinc.com/resources/>
You have to subclass NSTextFieldCell, specifically -drawInteriorWithFrame to
call the method in the above-mentioned source, but that part's pretty easy.
Feel free to contact me if you have any questions.
Hope that helps,
Evan Gross
--
+------------------------------------------------------------------------+
| Evan Gross, President, Rainmaker Research Inc. |
| - Developers of Macintosh and Windows Software - |
| Spell Catcher for Mac OS and Windows |
| Visit <
http://www.rainmakerinc.com> |
_______________________________________________
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.