MacApp Text Editor
Volume Number: 3
Issue Number: 2
Column Tag: MacApp Objects
A MacApp Text Editor
By David Goldsmith, MacApp Project Manager, Apple Computer, Inc.
The January 1987 issue of MacTutor contained an article showing how to
implement a TextEdit based editor, MyWrite, in LS Pascal, which allows editing of
multiple documents at the same time, changing fonts, sizes, and styles, and supports
the usual Macintosh™ features of scrolling, resizing and moving windows, and so forth.
MyWrite is already a pretty sizeable program, but it is still missing features, such as:
1.Saving documents to and reading documents from disk.
2.Support for printing documents.
3.The ability to undo and redo commands.
4.Asking the user if s/he wants to save changes before closing or quitting.
5.Displaying informative messages if a problem occurs.
6.Making sure the program doesn’t run out of memory (or encounter some other
problem) and bomb.
Although MyWrite has most of the basic features of a Macintosh application,
there is a big difference between a sample application like this and a commercial
application. Producing a good commercial application requires that you attend to many
details like those listed above, while also trying to conform to the Macintosh user
interface and make your program competitive in the marketplace. In the pressure to
bring a program to market, some of these considerations may get short shrift, simply
because there isn’t time to deal with them. Yet the applications which supply all these
ingredients are the most successful.
As large as it is, the MyWrite program is simpler than most applications because
TextEdit does so much. TextEdit provides calls to handle mouse clicks, typing, screen
update, scrolling, cut and paste, highlighting of the current selection, and import and
export of the clipboard. Most applications, however, do not have a convenient ROM
package to do all this work for them. The result is more work for you.
On all computers, you must write the part of your application that does a job for
the user. On Macintosh, you must also provide the intuitive user interface, common
functions, and friendly operation that Macintosh owners expect. Adding these features
to a program that’s already large would certainly make it much too big to present in
the pages of MacTutor - unless we do it with MacApp™.
What is MacApp?
MacApp is an object oriented framework for Macintosh applications. It’s object
oriented because it uses Apple’s extended dialect of Pascal, called Object Pascal, part of