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

Re: customizing NSTextView


  • Subject: Re: customizing NSTextView
  • From: Douglas Davidson <email@hidden>
  • Date: Tue, 26 Nov 2002 12:03:29 -0800

On Tuesday, November 26, 2002, at 11:49 AM, Koen van der Drift wrote:

This depends somewhat on exactly what sort of customization you want.


An example of what I am trying to do can be seen in the bottom panel of this screenshot:

http://www.informaxinc.com/pix/solutions/mac1_lg.gif


So the user types in a string of characters and the view adds all kinds of additional information, line numbering, different colors, etc. From your description it looks like for such a case I should subclass NSLayoutManager, although in my case the view is not as complicated as in the screenshot.

The indicated example is an annotated genetic sequence, with pairs of lines containing fixed numbers of characters from the set {A, C, G, T}, plus annotations both to the left of and above each pair of lines. There are several options for this sort of thing. Since it is so heavily modified from the standard text view, it might be a candidate for a custom view not inheriting from NSTextView at all. If an NSTextView is used, the text view could draw the annotations, based on the information it receives from the layout manager. A custom NSLayoutManager subclass could be used to draw some of the annotations, particularly those above the line pairs, although it is not clear to me whether these annotations are associated with individual glyphs or not. Subclassing NSLayoutManager is particularly suitable in the case of decorations that are definitely associated with individual glyphs, such as (for example) the Chinese zhuyin fuhao annotations.

Douglas Davidson
_______________________________________________
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: 
 >Re: customizing NSTextView (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: NSTableView, NSTextView weirdness
  • Next by Date: Re: Conditionally formatting cells in an NSTableView
  • Previous by thread: Re: customizing NSTextView
  • Next by thread: Conditionally formatting cells in an NSTableView
  • Index(es):
    • Date
    • Thread