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

Re: Sharing an NSTextView


  • Subject: Re: Sharing an NSTextView
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 29 Jan 2003 12:59:57 -0800

On Wednesday, January 29, 2003, at 11:14 AM, Nico wrote:

I'm setting up a text view that will have different "documents" swapped into
it at different times (like the editor in an all-in-one Project Builder
window) and I don't know how to share the NSTextView.

I just need an NSTextView to be shown at two places at the same time.

A view cannot be shown in two places at the same time; any given view has at most one superview. However, it is possible to have two different NSTextViews display the same text. There is considerable conceptual documentation on this, but here is a brief overview: the model object for the text is an NSTextStorage; a text storage may be associated with any number of NSLayoutManagers, which act as controller objects; each NSLayoutManager is a single presentation of the text. A given NSLayoutManager in turn may be associated with one or more NSTextViews, which represent the pages (or other containers) in that layout manager's presentation of the text. So, for example, if each of your presentations of the document is to be in a single long text view, then you would have one NSTextStorage, two NSLayoutManagers, and two NSTextViews. There is an ADC sample called TextViewConfig that shows this sort of thing--actually it is a slightly more complicated configuration, but it should give the general idea.

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: 
 >Sharing an NSTextView (From: Nico <email@hidden>)

  • Prev by Date: Re: drawing text on a path?
  • Next by Date: Re: [loading 16-bit png,psd|loading tiff from stdout]
  • Previous by thread: Sharing an NSTextView
  • Next by thread: Loading images in an array while app is loading
  • Index(es):
    • Date
    • Thread