Clipping drawn text with an ellipsis
Clipping drawn text with an ellipsis
- Subject: Clipping drawn text with an ellipsis
- From: Pete Yandell <email@hidden>
- Date: Wed, 12 Jun 2002 13:54:18 +1000
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.
Pete Yandell
http://pete.yandell.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.