RE: NSLayoutManager question
RE: NSLayoutManager question
- Subject: RE: NSLayoutManager question
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Mon, 3 Feb 2003 17:14:03 -0500
If you were using a text field instead of a text view, I would say an
NSFormatter subclass is what you want. It's main benefit is to present the
information to the user in human-friendly format while allowing calculations
and other manipulations on the actual value. I don't think a text view will
take a formatter, but I could be wrong.
Would a text field work for you?
Jonathan
>
-----Original Message-----
>
From: email@hidden
>
[mailto:email@hidden]On Behalf Of Koen van der Drift
>
Sent: Monday, February 03, 2003 4:38 PM
>
To: email@hidden
>
Subject: NSLayoutManager question
>
>
>
Hi,
>
>
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?
>
>
>
thanks,
>
>
- Koen.
>
_______________________________________________
>
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.
_______________________________________________
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.