• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Clipping drawn text with an ellipsis
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Clipping drawn text with an ellipsis
      • From: Ryan Dingman <email@hidden>
  • Prev by Date: Re: Drag and Drop Oddities
  • Next by Date: Re: Executing methods in one class from within another
  • Previous by thread: Re: Attributed strings in outlineviews
  • Next by thread: Re: Clipping drawn text with an ellipsis
  • Index(es):
    • Date
    • Thread