Re: Newbie TextEdit Sample Question
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.