Re: Clipping drawn text with an ellipsis
Re: Clipping drawn text with an ellipsis
- Subject: Re: Clipping drawn text with an ellipsis
- From: "Timothy J. Wood" <email@hidden>
- Date: Wed, 12 Jun 2002 11:17:16 -0700
Actually there is an implementation of this in OmniAppKit -- see
NSAttributedString-OAExtensions.m
-tim
On Tuesday, June 11, 2002, at 10:12 PM, Ryan Dingman wrote:
Unfortunately, you'll have to roll your own. Apple has planned for
allowing developer's to do this since the define the
NSLineBreakByTruncatingTail line break mode. The following code would
work except for the fact that Apple hasn't bothered to implement the
NSLineBreakByTruncatingTail link break mode.
[...]
On Tuesday, June 11, 2002, at 08:54 PM, Pete Yandell wrote:
I'm sure this one must have been covered before, but I can't find it
in archives or docs, so...
I'm drawing text using NSString's drawInRect:withAttributes: method.
This method wraps the text onto multiple lines if it doesn't fit
within the width of the given rectangle. What I want to do is have
the text clipped to the edge of the rectangle with an ellipsis (...)
appended, a la the OS 9 Finder with filenames. (The OS X Finder, of
course, is super clever and puts the ellipsis in the middle, but I
don't need that.)
Anyone know if there is a simple way to do this? I'm trying to avoid
rolling my own routine to do the job and thereby reinventing the wheel.
_______________________________________________
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.