• 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: cocoa-dev digest, Vol 2 #1877 - 17 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa-dev digest, Vol 2 #1877 - 17 msgs


  • Subject: Re: cocoa-dev digest, Vol 2 #1877 - 17 msgs
  • From: Nebagakid <email@hidden>
  • Date: Wed, 29 Jan 2003 22:06:39 -0500

Hi, I want to do something similar to this, capturing the contents of an NSTextView. Do you have to declare the NSTextStorage first (NSTextStore *textStorage) and if so, how does one set the contents of the textStorage to the contents of the Text View, I am having a great deal of trouble with this... Thanks

-Danny Cohen

On Wednesday, January 29, 2003, at 07:34 PM, Douglas Davidson wrote:

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.

  • Prev by Date: Re: Action based undo or snapshot based undo?
  • Next by Date: Re: Child windows?
  • Previous by thread: Re: UTF-8 characters in domain names
  • Next by thread: "Universal spell-check" algorithm and function morphemes
  • Index(es):
    • Date
    • Thread