Code from the book "Macintosh Programming Secrets", 2nd Edition, by Scott Knaster
Chapters:
- Chapter 3 - Standard Stuff
- Chapter 4 - Dialogs
- Chapter 5 - Quick Draw
- Chapter 6 - Mouse
- Chapter 7 - Windows
- Chapter 8 - Files
- Chapter 9 - Standalone
- Chapter 10 - Various Adventures
Note: Two directories are provided, both of which contain the same source code. One (with_LF/
) contains source files using line feeds (LF) for reading on macOS/OS X, the other (with_CR/
) uses carriage returns (CR) for Macintosh.
Each chapter's changes to Standard_Stuff.c
are enclosed by pre-processor conditionals (#ifdef
and #endif
). So to activate a particular chapter's changes to Stabdard_Stuff.c
you need to include
#define __chapter<X>__
So, for chapter 4,
#define __chapter4__
As all of the filenames in the varius chapters are the same, i.e. Standard_Stuff.c
or Neat_Stuff.c
, in order to distinguish the files, a suffix of _Ch<X>
has been included, i.e. Standard_Stuff_Ch7.c
or Neat_Stuff_Ch4.c
Also, instead of spaces in filenames, Standard Stuff.c
, we use an underscore Standard_Stuff.c
.
The resource definitions would not be parsed, when compiling .r
files, if included with function declarations in the header file Standard_Stuff.h
. To remedy this, a Standard_Stuff_ResDefs.h
file was created to seperate the resource definitions from the function declarations. This file should be #included in the Standard Stuff header file and the resource defintiions commented out (or deleted) from the header file Standard_Stuff.h
As the resoure file Standard_Stuff.r
is the same name for each chapter, but the contents differ wildly, a file name suffix _Ch<X>
, has been used, i.e. Standard_Stuff_Ch7.r
.
As the resoure file definitions Standard_Stuff_ResDefs.r
is the same name for each chapter, but the contents differ wildly, a file name suffix _Ch<X>
, has been used, i.e. Standard_Stuff_ResDefs_Ch7.r
.
- Source code for Macintosh Programming Secrets - Second Edition (1992)
- Errata - Macintosh Programming Secrets (1992)
- greenonline/Creation_from_Programmers_Guide_to_MPW_1990
- greenonline/Bug_fixes_for_the_hundredrabbits_repo
- greenonline/Code_from_Macintosh_Programming_Secrets_1988
- greenonline/Code_from_Macintosh_Programming_Secrets_1992
- Others: