# Extending the Macintosh Toolbox 1991 — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/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-extending-the-macintosh-toolbox-1991-22a35a/1#scan-685f7fac36677b724b612d0742c8a6172623b01eae109e8ba83e9e6f6f722e0d)

Extending the Macintosh Toolbox

Transcribed text:

SERIES EDITOR SCOTT KNASTER

Macintosh Inside Out

Extending the Macintosh® Toolbox

Programming Menus, Windows, Dialogs, and More

JOHN C. MAY
JUDY B. WHITTLE

Image description: Book cover with a yellow background, a red and blue top band, an orange downward-pointing triangle labeled Macintosh Inside Out, a large teal and black title over a tan panel with a yellow circle behind it, and author names in serif capitals at the bottom.

Reading notes: Series editor line and top band text are small and placed along the red band; reading order follows visual layout. Author names are set in widely spaced capitals; a small smudge overlaps the bottom of the cover near the second author's name but the text is legible.

Languages: English

[Original Image 1](https://www.vintageapple.net/files/c7d0f5675b968eca467c7387ae5aea745ca7d47ee4c310bd822a60b808fe59c1/573f048b4080f4bdc41ebd6d.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/1#scan-ca0fe7e076c65e42abd17d41d9ba1ed60880d35d249144dd8d034f6dba306224)

Transcribed text:

S   G 0   TT KNA S   T   ER
Extending~~_____,
he
Programming   Menus,   VVlndows,
Dialogs,   and More
JOHN _C.MAY
.•·
J   U   DY   / B   . W H I T T L E

Reading notes: No image was provided; the copy comes only from the supplied extracted text, so layout and reading order are inferred. The top line 'S G 0 TT KNA S T ER' is fragmented and may be a title or series name, so it was not treated as a headline. 'Extending~~_____,' is partly obscured and its wording is uncertain. The line 'he' is an isolated fragment of unclear origin. 'VVlndows' appears to be an OCR rendering of 'Windows'. 'J U DY / B . W H I T T L E' is letter-spaced; the name is read as 'JUDY B. WHITTLE'. Transcript was intentionally left empty per the instruction that exact extracted text is preserved separately.

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/bd4236bb0637c2bc816d358d605ae15c20af415e72a3de9dacfc3d1210a003e2/Extending_the_Macintosh_Toolbox_1991.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/1#scan-dde57bd37e6babdb70e77787d052c8bae6899d13432b15963d553283099d2074)

Image description: A plain, entirely blank white page with no artwork, layout elements, or visible marks.

Reading notes: The image appears to be entirely blank with no visible text, so all printed fields are empty.

[Original PDF page 2](https://www.vintageapple.net/files/bd4236bb0637c2bc816d358d605ae15c20af415e72a3de9dacfc3d1210a003e2/Extending_the_Macintosh_Toolbox_1991.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/1#scan-b34b9b65a4969fbc63deca937dfa3192d349db8891d22f646a3f204d46815150)

Extending the Macintosh® Toolbox

Transcribed text:

Extending the
Macintosh®   Toolbox
Programming Menus, Windows,
Dialogs,   and More
John C. May
Judy B.   Whittle
Addison-Wesley Publishing Company, Inc.
Reading, Massachusetts   •   Menlo Park, California   •   New   York
Don Mills,   Ontario•   Wokingha~,   England•   Amsterdam
Bonn   •   Sydney   •   Singapore   •   Tokyo   •   Madrid   •   San Juan
Paris•   Seoul•   Milan•   Mexico   City•   Taipei

Reading notes: Source line 'Wokingha~' appears to be a damaged or OCR-garbled character sequence, likely 'Wokingham'

Printed product names: Macintosh® Toolbox

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/bd4236bb0637c2bc816d358d605ae15c20af415e72a3de9dacfc3d1210a003e2/Extending_the_Macintosh_Toolbox_1991.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/1#scan-d572ba55ac50c8661404b0b47fb71f5729297717b71c2f5a9996bf7fc98547bb)

Transcribed text:

Many of the designations used by manufacturers and sellers to distin-
guish their products are claimed as trademarks. Where those designa-
tions appear in this book and Addison-Wesley was aware of a trademark
claim, the designations have been printed in initial capital letters.
Library of   Congress Cataloging-in-Publication Data
May,   John c.
Extending the   Macintosh toolbox   :   programming menus,
windows,   dialogs   and more   I   John   C.   May,   Judy   B.   Whittle.
p.   cm.   --   (Macintosh inside out)
Includes bibliographical references   and index.
ISBN   0-201-57722-4
1.   Macintosh   (Computer)--Programming.   2.   Macintosh Toolbox
(Computer programs)   I. Whittle,   Judy B.   II. Title.   III. Series.
QA76.8.M3M3765   1991   91-14461
005.265--dc20   CIP
Copyright© 1991 by John   C.   May and Judy B. Whittle
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.
The authors and publishers have taken care in preparation of this book,
but make no express or implied warranty of any kind and assume no
responsibility for errors or omissions.No liability is assumed for inciden-
tal or consequential damages in connection with or arising out of the use
of the information or programs contained herein.
Sponsoring Editor: Carole McClendon
Project   Editor: Elizabeth Rogalin
Cover design: Ronn Campisi
Set   in   10.5-point   Palatino   by   Don Huntington
12 3 4 5 6 7 8 9 -MW- 9594939291
First printing, August 1991

Reading notes: Headline not clearly identifiable as a primary printed heading in the supplied text Spacing irregularities in the cataloging data may reflect OCR artifacts

Printed product names: Macintosh

Printed dates: 1991 · August 1991

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/bd4236bb0637c2bc816d358d605ae15c20af415e72a3de9dacfc3d1210a003e2/Extending_the_Macintosh_Toolbox_1991.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/1#scan-d94d9e2342a662935522bb64c4a3eafc26670f34ebd28584f234b2ea44a76844)

Image description: A plain, entirely blank white page with no artwork, layout elements, or printed content visible.

Reading notes: The image appears to be fully blank with no visible text, so the transcript and all printed fields are empty.

[Original PDF page 5](https://www.vintageapple.net/files/bd4236bb0637c2bc816d358d605ae15c20af415e72a3de9dacfc3d1210a003e2/Extending_the_Macintosh_Toolbox_1991.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/1#scan-2e53a5f87a7afa0bef15c3348228750381b617cf81e45bf16afd9cf4ebb14057)

Transcribed text:

1.
Contents
Foreword   by   Scott   Knaster
Preface   xix
Acknowledgments   xxi
Introduction   1
Is This Book for   You?   1
How the Book Is Organized   1
Conventions   Used   2
xvii
Data Are or Data Is?   2
Punctuation with Code   2
Capital Letters in   Source   Code   2
Monospace Font for Code   3
Using   the Routines in This Book   3
2.   Programming   Language   5
Programming   Language   Used   in This Book   5
C   Program.ming   Standards   5
Case (Switch) Statements   5
Brace Rule 1 (separate lines)   6
Brace Rule   2   (if and else)   7
Parentheses Rule 1 (statements)   8
Parentheses Rule   2   <Junctions)   8
vii

Reading notes: Source is a table of contents with OCR-like spacing artifacts, e.g. 'C Program.ming' and 'Parentheses Rule 2 <Junctions)'. Uncertain reading of 'Program.ming' and '<Junctions)' in the supplied text.

Languages: English

[Original PDF page 6](https://www.vintageapple.net/files/bd4236bb0637c2bc816d358d605ae15c20af415e72a3de9dacfc3d1210a003e2/Extending_the_Macintosh_Toolbox_1991.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/1#scan-2b63e5ca042eece4e0c5c5d3b5ad75663e858401b40a99879c8422aaf354069d)

Transcribed text:

viii   ..,..   Contents
Arithmetic Operators Rule   9
Commas Rule   9
Semicolon Rule   10
Capitalization Rule 1 (junctions)   10
Capitalization Rule   2   (variables)   10
Useful   Macros   11
Handling Errors   12
The Way Apple Prefers   You   to Program   12
3.   Initializing the Toolbox   15
Setting   Up   Your   Program with lnit ToolBox.c   15
Summary   19
4.   Menus   21
Overview of Menus   21
Building Menus   21
InitMenu.c   22
The Apple Menu   23
DoAppleMenu.c   23
Routines Involving Menu Items   24
DablMenultem.c   24
EablMenultem.c   25
DAllMenultems.c   25
EAllMenultems.c   26
MarkMenultem.c   27
Testing the Keyboard   28
CommandlsDown.c   29
CapsLocklsDown.c   30
ControllsDown.c   31
OptionlsDown.c   31
ShiftlsDown.c   32
Using   an 'MBAR' Resource   32
DrawMBar.c   33
A Simple Menu Example   34
MenuExample.c   34
MenuExample.R   35
Summary   36
Recommended Reading   36

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/bd4236bb0637c2bc816d358d605ae15c20af415e72a3de9dacfc3d1210a003e2/Extending_the_Macintosh_Toolbox_1991.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/1#scan-f71c0e0ba660c2a48797e9ec8d5c21c8f995ebe660b2d59abad48e36e7fdbd68)

Transcribed text:

5.   Cursors   37
Overview of Cursors   37
Using   Black-and-White and Color Cursors   37
FetchCursor.c   38
A Simple Cursor Example   41
CursorExample.c   41
CursorExample.R   43
Summary   48
Recommended Reading   48
6.   Windows and Dialogs   49
Overview of Windows and Dialogs   49
Dialog Records   50
Creating Dialogs   51
OpenDialog.c   51
Dialog Positioning   52
CenterDialog.c   52
Window Positioning   54
CenterWindow.c   54
Window Stacking   56
StackWindow.c   56
Writing Your   Own   Modal Dialog Routine   58
MyModalDialog.c   59
Changing the Default Dialog Font   66
SetDFont.c   66
..,..   Contents   ix
Creating a General-Purpose About Dialog Routine   67
AboutDialog.c   68
The About Example   70
AboutExample.c   70
AboutExample.R   72
Creating a General-Purpose Copyright Routine   73
CopyrightDialog.c   73
Summary   76
Recommended Reading   76

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/bd4236bb0637c2bc816d358d605ae15c20af415e72a3de9dacfc3d1210a003e2/Extending_the_Macintosh_Toolbox_1991.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/1#scan-0e9e679afdb2200148693cea0ce6340f96b1abf057fc03de9b8fa538ec4aa666)

Transcribed text:

x   ~   Contents
7.   Alerts   77
Overview of Alerts   77
A General-Purpose Alert Routine   78
NoteAlert.c   78
CautionAlert.c   79
StopAlert.c   80
A Standard Confirmation Alert Routine   81
Confirmation.c   81
The Alert Example   83
AlertExample.c   83
AlertExample.R   85
Summary   86
Recommended Reading   86
8.   Resources   87
Overview of Resources   87
Resource Compilers   92
Resource Editors   92
Special-Purpose Editors and Builders   93
Resource Decompiler   93
RMaker   Program   Syntax   93
RadioButton.R   95
Resource File Merging and Overwriting   98
Summary   99
Recommended Reading   99
9.   Buttons   101
Overview of Buttons   101
Routine to Draw the   Outline   of a Default Button   101
FrmDefltem.c   102
A Simple Button Example   105
ButtonExample.c   106
ButtonExample.R   107
Summary   108
Recommended Reading   108

Reading notes: Source text is a table of contents for a programming book, with page numbers and chapter titles; no advertised products or prices are present. Hyphenation or line-break spacing in some entries (e.g., 'Recommended Reading') may not reflect exact printed layout.

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/bd4236bb0637c2bc816d358d605ae15c20af415e72a3de9dacfc3d1210a003e2/Extending_the_Macintosh_Toolbox_1991.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/1#scan-af26b98a4110018d6e640360b7586f34af8cd2c0161cd4dba261a84b11e6babf)

Transcribed text:

10.   Check Boxes   109
Overview of Check Boxes   109
Getting and Setting the Check Box State   109
PutCheckBox.c   110
GetCheckBox.c   111
Toggling the Check Box State   112
ToggleCheckBox.c   112
A Simple Check Box Example   113
CheckBoxExample.c   113
CheckBoxExample.R   115
Summary   117
11.   Radio Buttons   119
Overview of Radio Buttons   119
Setting the Radio Button State   119
GetRadioButton.c   120
PutRadioButton.c   121
Grouping Radio Buttons   123
PushRadioButton.c   123
A Simple Radio Button Example   125
RadioButtonExample.c   125
RadioButtonExample.R   126
Summary   128
12.   Icons   129
Overview of   Icons   129
Using   Icons as Control Buttons   130
GetButton!con.c   130
DoButton!con.c   133
DispButton!con.c   136
Using   Icons as Toggle Switches   136
GetTogglelcon.c   137
DoTogglelcon.c   138
DispTogglelcon.c   140
IconO.ff.c   141
IconOn.c   142
A Simple Icon Example   143
IconExample.c   143
IconExample.R   145
Summary   147
...,.   Contents   xi

Reading notes: Source is a table of contents with page numbers; no advertised products, prices, or dates present. Some entries contain possible OCR spacing artifacts such as 'Overview of   Icons' and 'DoButton!con.c'.

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/bd4236bb0637c2bc816d358d605ae15c20af415e72a3de9dacfc3d1210a003e2/Extending_the_Macintosh_Toolbox_1991.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/1#scan-a08b29b648a2cc4b49ddf3df629b61badd1c488680ab8b4a225998d9ce293a0e)

Transcribed text:

xii   ~   Contents
13.   Pictures   149
Overview of   Pictures   149
Drawing a   Picture   149
DrawPict.c   150
A Simple   Picture   Example   151
PictExample.c   151
PictExample.R   154
Summary   161
Recommended Reading   161
14.   Static Text   163
Overview of Static Text   163
Active and Inactive Static Text   163
ActiveStatic.c   163
InactiveStatic.c   164
A Simple Static Text Example   165
StaticTextExample.c   166
StaticTextExample.R   167
Summary   168
Recommended Reading   168
15.   Edit Text   169
Overview of Edit Text   169
Active Edit Text Fields   170
GetActiveEditText.c   170
SetActiveEditText.c   171
Input and   Output   Routines for Integers   173
InputShort.c   174
InputLong.c   178
InputHexShort.c   179
InputHexLong.c   181
OutputShort.c   183
OutputLong.c   186
OutputHexShort.c   187
OutputHexLong.c   188
Input and   Output   Routines for Floating-Point Numbers   190

Reading notes: Source text is a table of contents fragment with page numbers rather than advertising copy; no headline or advertised products identified. Heading line 'Overview of Pictures' and similar entries contain no explicit product names or prices.

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/bd4236bb0637c2bc816d358d605ae15c20af415e72a3de9dacfc3d1210a003e2/Extending_the_Macintosh_Toolbox_1991.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-extending-the-macintosh-toolbox-1991-22a35a/2.md)
