• 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: Newbie TextEdit Sample Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie TextEdit Sample Question


  • Subject: Re: Newbie TextEdit Sample Question
  • From: Andy Lee <email@hidden>
  • Date: Thu, 25 Apr 2002 16:20:11 -0400

At 11:12 AM -0700 4/25/02, Umed Zokirov wrote:
I was skimming through the code of TextEdit application and had some questions.
To start with the document window's content view is a subclass of NSScrollView and
since it is a text-editing app I was wondering how an NSScrollView can handle text-entry.
I realize that the sample is outdated and today people would normally use NSTextView and NSScrollView
or subcalsses of it. In this app the text mechanism is built by hand, i.e NSLayoutManager and NSTextStorage
objects are created by hand and so on. My question is that how NSScrollView object loads text from NSTextStorage object?
I did not see a connection.

I haven't looked closely at the code, but from a quick look it appears that an NSTextView is created by hand and added to the view hierarchy, presumably inside the NSScrollView. So the NSScrollView does not handle text directly; the NSTextView inside it does all the work.

--Andy
_______________________________________________
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: 
 >Newbie TextEdit Sample Question (From: "Umed Zokirov" <email@hidden>)

  • Prev by Date: Wait/busy cursor and long delays
  • Next by Date: Re: Wait / Busy Cursor
  • Previous by thread: Newbie TextEdit Sample Question
  • Next by thread: NSStepper - How can I tell which arrow has been clicked?
  • Index(es):
    • Date
    • Thread