• 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: NSLayoutManager question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLayoutManager question


  • Subject: Re: NSLayoutManager question
  • From: Brian Webster <email@hidden>
  • Date: Mon, 3 Feb 2003 16:11:38 -0600

NSTextContainer would be better suited to doing this than NSLayoutManager. If you write your own subclass of NSTextContainer, you can use it to define what regions of a text view you want text to flow into. So, your subclass would only allow ten characters at a time to be laid out, putting a gap in between each line fragment. Take a look at the "Text System Storage Layer" programming topic in the Cocoa docs for more info on how to write an NSTextContainer subclass.

On Monday, February 3, 2003, at 03:51 PM, email@hidden wrote:

In my app I display a sequence of letters (aminoacids in a protein).
To make the string more readable, a common feature in many apps is to
add a space after each ten amino acids. So last night I was trying to
add this feature. What I did was each time the sequence is edited, I
remove all spaces and then I iterate the string backwards and add a
space in the correct position. This works. However, I also need the
string *without* the spaces for calculations, such as pattern
matching, or molecular weight calculation.

Then it occurred to my that I was trying to manipulate the model
(protein string) in the view (MyNSTextView), so I was wondering if I
can, and how, do the spaces by using the NSLayoutManager. Another
thing I could do is to keep a copy of the protein around *without*
the spaces that I use for the calculations, and use the 'original'
string of the NSTextView for the display.

Any suggestions on this?

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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: NSLayoutManager question
      • From: Koen van der Drift <email@hidden>
    • Re: NSLayoutManager question
      • From: Koen van der Drift <email@hidden>
  • Prev by Date: RE: NSLayoutManager question
  • Next by Date: Re: Hidden Objects
  • Previous by thread: RE: NSLayoutManager question
  • Next by thread: Re: NSLayoutManager question
  • Index(es):
    • Date
    • Thread