• 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: setting tab stops in a document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting tab stops in a document


  • Subject: Re: setting tab stops in a document
  • From: Ross Carter <email@hidden>
  • Date: Sat, 05 Jun 2010 12:16:48 -0400

On Jun 5, 2010, at 1:09 AM, Boyd Collier wrote:

> In an application I'm working on, I read in plain text files containing data to be analyzed.  This uses a slightly-modified version of MyDocument.m that is produced as a result of starting a project with the template for NSDocument architecture.  The modification that I made was to add a method named updateView, which is called near the end of windowControllerDidLoadNib and loadDataRepresentation: ofType:
>
> My reason for adding this method is to make the spacing of tabs something that works well for the sort of data files being analyzed, which presume tabs are used to separate values being analyzed.  	Here's the code:
...
> [[textView textStorage] addAttributes:attrs range:NSMakeRange(0, [[[textView textStorage] string] length])];


Couple of suggestions:

1. Call NSTextView -shouldChangeTextInRange:replacementString: before modifying the textStorage, and call -didChangeText afterward.

2. Look at NSTextView -setDefaultParagraphStyle:.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

  • Follow-Ups:
    • Re: setting tab stops in a document
      • From: Boyd Collier <email@hidden>
References: 
 >setting tab stops in a document (From: Boyd Collier <email@hidden>)

  • Prev by Date: setting tab stops in a document
  • Next by Date: Re: detecting touch and hold vs touch in UIButton
  • Previous by thread: setting tab stops in a document
  • Next by thread: Re: setting tab stops in a document
  • Index(es):
    • Date
    • Thread