# C++ Programming with MacApp — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1)

## Transcribed source material

Machine transcriptions and image descriptions; uncertain copy may be marked [illegible]. Verify against the linked originals. Historical rights remain with the original owners.

These are transcribed excerpts, not the full publications. Open the originals for remaining pages.

### Image 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-9ab03357ccd77378bdad9e4ee860fc630b9e1cc242d59c912e9fa6373bff090e)

C++ Programming with MacApp

Transcribed text:

SERIES EDITOR SCOTT KNASTER
Macintosh Inside Out
C++ Programming
with
MacApp®
DISK INCLUDED
DAVID A. WILSON
LARRY S. ROSENSTEIN
DAN SHAFER

Image description: Book cover with a green inverted triangle at top bearing 'Macintosh Inside Out', a tilted tan panel with large black 'C++ Programming', a yellow arc containing 'WITH', an orange band with large red 'MacApp®' lettering, a small blue floppy disk icon labeled 'DISK INCLUDED', and author names in black serif capitals at the bottom.

Reading notes: Series editor line and 'Macintosh Inside Out' tagline are set in small red and cream type; reading order taken as top-to-bottom. The word 'WITH' is set along a curved yellow arc and may be read in a different order by some readers. Registered trademark symbol after MacApp is small and assumed to be ®.

Printed product names: MacApp · Macintosh Inside Out

Languages: English

[Original Image 1](https://www.vintageapple.net/files/22bd96bf446c365466fa70a0d5e4622ce071d84d48bb00ac8dcb9ca032e5b304/8fecbfe45819f5da25d5daf4.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-ebee02a3c99a66aeb711ca119319b2f4ea3b35957e9eefb2577814cc03c80a61)

C++ Programming with MacApp

Transcribed text:

SERIES EDITOR SCOTT KNASTER

Macintosh Inside Out

C++ Programming

WITH

MacApp®

DISK INCLUDED

DAVID A. WILSON
LARRY S. ROSENSTEIN
DAN SHAFER

Image description: A book cover with a cream background, a green downward-pointing triangle at top holding the series title, a tilted tan panel behind large black 'C++ Programming' lettering, a yellow arc with 'WITH' and an orange panel with pink 'MacApp' lettering, and a small blue floppy disk icon marked 'DISK INCLUDED' at right.

Reading notes: The series line 'SERIES EDITOR' and 'SCOTT KNASTER' sit on a red and blue band at top and are partly printed in a spaced-out style; reading order is inferred from layout. The word 'WITH' is set along a curved yellow arc and its letters are rotated, so its reading order is inferred. The registered trademark symbol after MacApp is small and was transcribed as ®.

Printed product names: MacApp

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/7e80b7f10215c3bfa3c7b433fe3769735e3a3e83374e78e97233e0d0561a33c1/C-_Programming_with_MacApp_1987.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-435473f84a3cd16cb577bb4749b6c1787050d3d56e24b88048a4b5df5493af4e)

Image description: The image is a entirely blank white page with no visible artwork, layout, or text.

Reading notes: No visible text or imagery found; the page appears blank.

[Original PDF page 2](https://www.vintageapple.net/files/7e80b7f10215c3bfa3c7b433fe3769735e3a3e83374e78e97233e0d0561a33c1/C-_Programming_with_MacApp_1987.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-84ce25cd0874bb444821c1f6b46fcb72f24d7cfaa46b842b801803a10f896bad)

C++ Programming with MacApp

Transcribed text:

C++ Programming
with MacApp
David A.   Wilson
Larry   S.   Rosenstein
Dan Shafer
Addison-Wesley Publishing Company, Inc.
Reading, Massachusetts   Menlo   Park,   California   New York
Don Mills, Ontario   Wokingham, England   Amsterdam   Bonn
Sydney   Singapore   Tokyo   Madrid   San Juan

Printed product names: MacApp

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/7e80b7f10215c3bfa3c7b433fe3769735e3a3e83374e78e97233e0d0561a33c1/C-_Programming_with_MacApp_1987.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-65086715dde807000d2c3499ad51cc9cd457ae0c3489abc8c86e068c857852cb)

Transcribed text:

Many of the designations used by manufacturers and sellers to
distinguish their products are claimed as trademarks. Where those
designations appear in this book and Addison-Wesley was aware of
a trademark claim, the designations have been printed in initial
capital letters (e.g., Apple is a registered trademark of Apple
Computer, Inc.)
Copyright© 1990 by David   A.   Wilson, Larry   S.   Rosenstein, and Dan
Shafer
Some   of the art in this manuscript is copyrighted by Trici Venola
and Kurt Wahlner. Copyright© 1987.
All rights reserved. No part of this publication may be reproduced,
stored in a retrieval system, or transmitted, in any form or by any
means, electronic, mechanical, photocopying, recording, or
otherwise, without the prior written permission of the publisher.
Printed in the United   States   of America. Published simultaneously
in Canada.
Sponsoring   Editor: Carole McClendon
Technical Reviewer: Curt Bianchi
Cover Design: Ronn Campisi
Text Design: Copenhaver Cumpston
Set   in   10.5   point Palatino by Don Huntington
ISBN   0-201-57020-3
ABCDEFGHIJ-MW-9432100
First printing,   July   1990

Reading notes: Copyright line for art reads 'Copyright© 1987' with no explicit rights holder beyond named artists

Printed product names: Apple

Printed dates: 1990 · 1987 · July 1990

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/7e80b7f10215c3bfa3c7b433fe3769735e3a3e83374e78e97233e0d0561a33c1/C-_Programming_with_MacApp_1987.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-4b0aaeea5a3b255575b5d0857c20666a2e6c6584abdb24dbac655f48223597f7)

Image description: The image is a entirely blank white page with no visible artwork, layout elements, or text.

Reading notes: No visible text or graphics appear anywhere on the page, so the transcript is empty.

[Original PDF page 5](https://www.vintageapple.net/files/7e80b7f10215c3bfa3c7b433fe3769735e3a3e83374e78e97233e0d0561a33c1/C-_Programming_with_MacApp_1987.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-c40522bf67b4fba2d7b96f6fb1010c8cc4c5df992175a75102ef589b26d38586)

Transcribed text:

Contents
Preface xxi
Acknowledgments   xxiii
IJll>   PART   ONE   The Framework   1
1.   Introduction   3
Is this Book for You?   3
Are   You   a   C   Programmer?   4
Are   You   a   Pascal   Programmer?   4
Are   You   a   C++   Programmer?   4
Are   You   a Good Programmer?   5
How Much Do You Need to Know?   6
Basic Programming Knowledge   7
Macintosh Knowledge   8
What's in This Book?   8
Patience as an Object   9
Joining   Other   MacApp Developers   9
Summary   10
2.   Getting   Started   with MacApp   11
What Is MacApp?   11
Who   Uses   MacApp?   12
Why Learn MacApp and Object Programming?   12
Making   You   a Better Programmer   12
vii

Reading notes: Source text contains spaced-out characters in some lines (e.g., 'C   Programmer'), reading as OCR spacing artifacts.

Languages: English

[Original PDF page 6](https://www.vintageapple.net/files/7e80b7f10215c3bfa3c7b433fe3769735e3a3e83374e78e97233e0d0561a33c1/C-_Programming_with_MacApp_1987.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-773571a0887d20682072146367f9ccd0f8948978bfd660ffbc64f3f3565dd74f)

Transcribed text:

viii   ~   Contents
C   and Pascal Are Not Enough   14
Features and Benefits of Object Programming   14
Object-Oriented Design   14
Readable, Maintainable Code   15
Reusable Code   15
Programming by Successive Refinement   16
Features and Benefits of MacApp   16
Full   User   Interface Support   16
Guaranteed Compatibility   17
Making   It   Easy to   Undo   17
Debugging Tools   17
Memory Management   18
Error Handling   18
Easy Printing   18
Easy Text Editing   18
Easy Dialogs   18
What Is Left for You to Do?   19
A Real-Life Example   19
Writing a Paint Program   20
Adding a New View   24
Changing Your Mind   Set   24
Programming in the Closet   25
The   Upside-Down   Library   26
Summary   28
3.   Object   Programming Concepts   29
Terminology   29
Learning Object Programming   30
What Are Objects?   30
Sending   Messages   33
Strange   Terminology   35
Where to Get Objects   35
Classes of Objects   36
Class Diagrams   36
Subclassing and Inheritance   37
Inheriting Properties   37
Overriding Properties   39
Reusing   Unique   Code   39

Reading notes: Source appears to be a table of contents with no advertised products, prices, or dates; headline not identifiable from supplied copy.

Printed product names: MacApp

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/7e80b7f10215c3bfa3c7b433fe3769735e3a3e83374e78e97233e0d0561a33c1/C-_Programming_with_MacApp_1987.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-7bb9abf59587328e783103dec7e093812fb615b1009a5b558d3a0dac16a00ba0)

Transcribed text:

The   Price   You   Pay   40
What's Different?   40
Programming with   Objects   42
The Learning Process   42
Obstacles   43
Review   44
Summary   45
.,.   Contents   ix
4.   Object-Oriented Design: Modeling the Real World   47
Where to Begin?   47
Nouns and Verbs   47
Photography   47
Think in Terms of Small Methods   48
Increasing Reusability   50
Subclass Existing Classes   50
Look for Common Properties   52
Assemble New Classes from Existing Ones   53
Moon Landing Simulator Example   56
Design Goal   56
Strategy   57
First Try at a Moon Lander Design   57
Improving the Design   58
An Even Better Design   59
Summary   61
_.,   PART   TWO   Getting Started in MacApp   63
5.   Setting   Up   MacApp with Macintosh Programmer's Workshop 65
The MPW Philosophy   65
What You Need to Get Started   66
Software   66
Recommended Hardware   66
Preparing the Hard Disk   67
The   MPW   Folder   67
The MacApp Folder   69
UsingMPW   73
Getting Help   74
The Mark Menu   76

Reading notes: Source appears to be a table of contents with no primary heading Some leading characters in the table of contents are damaged or ambiguous (e.g., '.,.' and '_.,')

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/7e80b7f10215c3bfa3c7b433fe3769735e3a3e83374e78e97233e0d0561a33c1/C-_Programming_with_MacApp_1987.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-c1e4489acddac396ab8c3eef74078cdd78ad5faad1e55fdfd4f9857153c87109)

Transcribed text:

x   ~   Contents
Pascal's Separately Compiled   Units   77
Creating Resources   79
Installing MacApp   82
Debug and Non-debug Versions of MacApp   83
Five Magic Files   84
Summary   86
6.   The Languages: Object Pascal and C++   87
A Bit of History   88
Object   Pascal   88
The   "Money"   Accounting Program   89
MPWTools   90
The Money.p file   91
Defining a Class   93
Defining a Subclass   93
Overriding a Method   94
Creating Objects   94
Sending a Message   95
Initialization Methods and SELF   96
Reusing Overridden Code   97
The Main Program   97
The Make File   98
Object   Pascal   Review   99
The C   ++ Language   99
Language Overview   99
New Features (Not Specifically Object-Oriented)   100
Overloaded Function Names   101
Defining a Class   104
Constructor Methods   106
Creating Objects   107
C++ Sample   Programs   108
The TinyBenchmark Program   108
Program Structure   108
Program Files   109
The Main Program   115
Building the Program   116
The Results   118
Benchmark, a More Elaborate   Program   120

Reading notes: Source appears to be a table of contents with page numbers; no primary heading is clearly printed.

Printed product names: MacApp · Object Pascal · C++ · MPWTools

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/7e80b7f10215c3bfa3c7b433fe3769735e3a3e83374e78e97233e0d0561a33c1/C-_Programming_with_MacApp_1987.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-32fba81877904a15552ce09e441cc2fd8a092142ef497014f855a026e1f96984)

Transcribed text:

Program Structure   120
Static and Dynamic Allocation of Objects   121
Defining the Test Class   123
The Test Methods   126
The Timer Classes   127
TLoopTimer Methods   129
Testing With a Main Program   130
Building the Program   135
Test Results   136
Back to Accounting   137
What We Still Have to Do   137
The New, Improved Money Program   137
Using   Multiple Source Files   140
The Main Program   142
Program Results   145
Details of the TOrder class   145
Details of the Customer Classes   147
Overriding a Method   151
Printing an Invoice   Using   Method Lookup   152
Details of the DataBase Class   153
Type Checking for Objects   154
Reusability and Maintainability   155
Building the Program   155
What Kind of Objects Get Created?   157
C++ Review   158
Summary   158
7.   The MacApp Class Library   159
Why Do We Need MacApp?   159
TObject: Everyone's Ancestor   162
Variables   162
IJJi.   Contents   xi
Methods Often   Used   by Your Application   162
Methods Often Overridden in Your Application   162
TEvtHandler: Handling Menu Items, Mouse Clicks, and Typing 162
Variables   163
Methods Often   Used   163
Methods Often Overridden   163
TApplication: Running the Main Event Loop   163

Reading notes: Source is a table of contents excerpt, not advertising copy; no advertised products or prices are present.

Printed product names: MacApp

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/7e80b7f10215c3bfa3c7b433fe3769735e3a3e83374e78e97233e0d0561a33c1/C-_Programming_with_MacApp_1987.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/1#scan-1848b4d7be99c787a23f4b95e43b98888a4ece395e7140ab0ce208c1c3e17999)

Transcribed text:

xii   ~   Contents
Instance Variables   164
Methods Always   Used   165
Methods   Often   Overridden   165
TDocument: Storing Information   166
Instance Variables   167
Method Always   Used   167
Methods Usually Overridden   167
TView: Displaying Information on the Screen   168
Instance Variables   169
Methods   Often   Used   170
Methods Usually Overridden   170
Methods Sometimes Overridden   171
TWindows   172
Instance Variables   172
Scrolling   173
Dialogs   174
View Review   174
TList: Keeping Track of a Collection of Objects   175
Methods   Often   Used   176
TCommand: Supporting Undo   176
Instance Variables   177
Methods Always   Used   177
Methods   Often   Overridden   177
Summary   178
8.   MacApp Default Behavior   179
Supporting the User Interface   179
Making   Your   Program Different   180
How Much Code Will   You   Have to Write?   181
Which Methods to Override   182
Launching the Application   182
Application Launched from Finder   183
Document   Opened   from Finder   183
Document Printed from Finder   183
Opening an Existing File   184
Saving a File to Disk   184
Handling Window Events   186
Update Event   186
Activate Event   187

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/7e80b7f10215c3bfa3c7b433fe3769735e3a3e83374e78e97233e0d0561a33c1/C-_Programming_with_MacApp_1987.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-c-programming-with-macapp-1987-28bab8/2.md)
