• 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
Re: Drawing text with '...' if it does not fit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing text with '...' if it does not fit


  • Subject: Re: Drawing text with '...' if it does not fit
  • From: Carsten G Pedersen <email@hidden>
  • Date: Tue, 2 Jan 2007 13:00:49 +0100

> On Jan 2, 2007, at 12:22, David Brennan wrote:
>
> > I am trying to draw a piece of text in a NSRect. If the text is too
> > long I don't want the text to wrap, I would like it to be truncated
> > and follewed by '...' so if the text is
> >
> > "a very long name", I want
> > "a very lo..."
>
> Try  http://developer.apple.com/documentation/Carbon/Reference/
> Appearance_Manager/Reference/reference.html#//apple_ref/c/func/
> TruncateThemeText
>
>

Alternatively to keep it all in the Cocoa domain you might want to draw an
attributed string with a paragraph style that specifies a line break mode
like NSLineBreakByTruncatingTail.

Carsten
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Drawing text with '...' if it does not fit (From: Nir Soffer <email@hidden>)

  • Prev by Date: Re: Way to determine size of a menu?
  • Next by Date: trouble with method passing a value to a custom view
  • Previous by thread: Re: Drawing text with '...' if it does not fit
  • Next by thread: trouble with method passing a value to a custom view
  • Index(es):
    • Date
    • Thread