Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!bu-cs!dartvax!eleazar.dartmouth.edu!earleh From: earleh@eleazar.dartmouth.edu (Earle R. Horton) Newsgroups: comp.sys.mac.programmer Subject: Re: More than 32k into a TextEdit window? Message-ID: <15574@dartvax.Dartmouth.EDU> Date: 14 Sep 89 17:02:28 GMT References: <10417@phoenix.Princeton.EDU> Sender: news@dartvax.Dartmouth.EDU Reply-To: earleh@eleazar.dartmouth.edu (Earle R. Horton) Organization: Thayer School of Engineering Lines: 35 In article <10417@phoenix.Princeton.EDU> bskendig@phoenix.Princeton.EDU (Brian Kendig) writes: >How do I get more than 32k into a TextEdit window? If I can't squeeze it >all into my TextEdit record, how can I simulate having it all there - >especially with the scroll bars? Sample code would be greatly appreciated. The following is quoted from Technical Note #203 "Don't Abuse the Managers." The words "text editor" may be substituted for "word processor" everywhere. In order to perform the operations required of a word processor it is necessary to use QuickDraw extensively. The expected Macintosh selection approach with autoscrolling, typing over selected text, cut/copy/paste, and so on are best implemented using QuickDraw directly. How the text is stored internally is the primary determining factor on how the word processor will perform. Don't be fooled by how easy it is to implement simple editing in an application. TextEdit is not a word processor. This is a pretty heavy-duty chunk of sample code you want here, to be sure. It has been done, but most of the good implementations I have seen are in products for which one cannot acquire the source code. I suggest you start off from scratch here, with a linked list of Handles to store lines or paragraphs of text. Gradually work your way up to a sophisticated memory management scheme so that the text is readily accessible to the display routines in your program. Finally, write a text display module which implements the full Macintosh interface for text. In order to avoid annoying limits, give your program the ability to swap unseen portions of documents to disk when memory gets tight. (This is optional, but it greatly increases the capabilities of any text editor.) Earle R. Horton