• 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: How do I remove all formatting (setUsesRuler:NO does not work) from an NSTextView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I remove all formatting (setUsesRuler:NO does not work) from an NSTextView?


  • Subject: Re: How do I remove all formatting (setUsesRuler:NO does not work) from an NSTextView?
  • From: Jeremy Dronfield <email@hidden>
  • Date: Fri, 20 Sep 2002 18:40:48 +0100

On Friday, September 20, 2002, at 04:25 pm, Gerben Wierda wrote:

I have an NSTextView that alternately displays RTF data and ASCII data. When the RTF data has been displayed, some aspects of it linger, mainly the ruler. When I display pure ASCII the text displays indented.

I tried:

[__inspectView setRichText:NO];
[__inspectView setUsesRuler:NO];
[__inspectView setFont:__fixedFont];

but to no avail, the ASCII text is displayed indented. What am I missing here?

If I understand your problem correctly, replacing the above code with the following, which restores the default alignment (NSNaturalTextAlignment), ought to solve it:


NSParagraphStyle *paraStyle = [NSParagraphStyle defaultParagraphStyle];

[[__inspectView textStorage] addAttribute:NSParagraphStyleAttributeName value:paraStyle range:NSMakeRange(0, [[__inspectView string] length])];

Note, it will only work if there is text in the view, but it should be easy enough to overcome this limitation. Hope this helps.
-Jeremy

========================================
email@hidden // email@hidden
The Alchemy Pages:
- fractious fiction at http://freespace.virgin.net/jeremy.dronfield
========================================
_______________________________________________
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.

References: 
 >How do I remove all formatting (setUsesRuler:NO does not work) from an NSTextView? (From: Gerben Wierda <email@hidden>)

  • Prev by Date: Re: Shielding Windows/Observations About Force Quit
  • Next by Date: Re: Shielding Windows/Observations About Force Quit
  • Previous by thread: How do I remove all formatting (setUsesRuler:NO does not work) from an NSTextView?
  • Next by thread: Re: How do I remove all formatting (setUsesRuler:NO does not work) from an NSTextView?
  • Index(es):
    • Date
    • Thread