• 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: wrapping text in an NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wrapping text in an NSTextView


  • Subject: Re: wrapping text in an NSTextView
  • From: Max Cantor <email@hidden>
  • Date: Wed, 16 May 2001 13:24:50 -0400

Could you be more specific, I couldn't discern exactly what you mean. Should I just make an attributed string with the attribute being the paragraph style? And then set that attributed string to the NSTextView with setStringValue?

-Max


On Wednesday, May 16, 2001, at 12:37 PM, Christopher Lloyd wrote:

Check out NSParagraphStyle, this can be an attribute in an NSAttributedString. So in this case you'd create a default paragraph style, make a mutableCopy, set the lineBreakMode to NSLineBreakByClipping (maybe NSLineBreakByTruncatingTail), then set it as an attribute on the NSRange of characters your interested in on the NSTextView's NSTextStorage.

Hope this helps,
Chris

At 12:20 PM 5/16/2001 -0400, Max wrote:
I have an NSTextView which I need to display text like a browser would handle a <pre> </pre> tag. Namely, I dont want it to wrap the text. I can't find anything in the api's to set this.
Anyone have any idea how to do this?

-Max


  • Follow-Ups:
    • Re: wrapping text in an NSTextView
      • From: Christopher Lloyd <email@hidden>
References: 
 >Re: wrapping text in an NSTextView (From: Christopher Lloyd <email@hidden>)

  • Prev by Date: Re: Cocoa CGI
  • Next by Date: Re: Cocoa CGI
  • Previous by thread: Re: wrapping text in an NSTextView
  • Next by thread: Re: wrapping text in an NSTextView
  • Index(es):
    • Date
    • Thread