home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / Programming / MacProgrammersFAQ Folder / MacProgrammersFAQ < prev   
Encoding:
Text File  |  1993-09-18  |  68.6 KB  |  1,872 lines  |  [TEXT/R*ch]

  1.  
  2.                      +---------------------------------+
  3.                      | Frequently Asked Questions List |
  4.                      |   for Comp.Sys.Mac.Programmer   |
  5.                      |         August 3, 1993          |
  6.                      +---------------------------------+
  7.                      
  8.  
  9.  
  10. This FAQ list is automatically posted once a week to comp.sys.mac.programmer.
  11. It is also available via anonymous ftp from ftp.cs.uoregon.edu [128.223.8.8]
  12. (user name 'anonymous', your internet address as password) in the files
  13. /pub/mac/csmp-faq-1 and /pub/mac/csmp-faq-2.
  14.  
  15. This FAQ list is maintained by Daryl Spitzer.  He can be reached at the
  16. following addresses:
  17.  
  18.    Internet:  Daryl_Spitzer@mindlink.bc.ca
  19.    SnailMail: 203 - 1385 West 12th Avenue
  20.               Vancouver, BC  (Canada)
  21.               V6H 1M2
  22.  
  23. The purpose of the FAQ list is to answer some of the most common questions
  24. asked on this group, and to refer people left with unanswered questions to
  25. available sources of additional help.  You should read the FAQ list before
  26. posting to comp.sys.mac.programmer.
  27.  
  28. Submissions, comments, etcetera, should be sent to Daryl Spitzer, as above.
  29. All such material sent will be considered to have entered the public domain
  30. (and will be subject to editing) unless specific text to the contrary
  31. accompanies the message (which may render the submission unusable).
  32.  
  33.  
  34.  
  35.                          Changes since August 3, 1992
  36.                          ----------------------------
  37.  
  38.  - the keeper of the FAQ is now Daryl Spitzer (Daryl_Spitzer@mindlink.bc.ca)
  39.  
  40.  - 1.2  Debuggers:
  41.     added Fritz Anderson's description of SourceBug
  42.  
  43.  - 2.1  The Associates and Partners Programs:
  44.     new description, DEVHOTLINE is no longer a valid AppleLink address
  45.  
  46.  - 2.3  APDA
  47.     new address and telephone numbers
  48.  
  49.  - 3.1.1  Technical Books
  50.     new Inside Macintosh volumes
  51.  
  52.  - 3.1.3  Periodicals:
  53.     MacTutor is now MacTech
  54.  
  55.  
  56.  
  57.  
  58.                              Table of Contents
  59.                               -----------------
  60.  
  61. Part One  (this file)
  62. ---------------------
  63.  
  64.   I.    Development Software
  65.           1. Compilers
  66.           2. Debuggers
  67.           3. Other Tools
  68.  
  69.   II.   Apple Developer Programs
  70.           1. The Associates and Partners Programs
  71.           2. Apple Developer University
  72.           3. APDA
  73.           4. Developer CDs
  74.  
  75.   III.  Sources of Information
  76.           1. Books and Periodicals
  77.                1. Technical Books
  78.                2. Teaching Books
  79.                3. Periodicals
  80.           2. Mailing Lists
  81.                1. Comp.Sys.Mac.Programmer Digest
  82.                2. Think Class Library Discussion
  83.                3. MacPsych
  84.           3. Miscellaneous
  85.                1. Usenet Mac Programmer's Guide (UMPG)
  86.                2. Kent Sandvik's Frequently Asked MPW C++ and MacApp
  87. Questions
  88.                3. Comp.Sys.Mac.FAQ
  89.  
  90.   IV.   Archive Sites
  91.           1. ftp.apple.com [130.43.2.3]
  92.           2. sumex-aim.stanford.edu [36.44.0.6]
  93.           3. rascal.ics.utexas.edu [128.83.138.20]
  94.           4. mac.archive.umich.edu [141.211.164.153]
  95.           5. ftp.cs.uoregon.edu [128.223.8.8]
  96.           6. ics.uci.edu [128.195.1.1]
  97.           7. ftp.brown.edu [128.148.176.55]
  98.           8. comp.binaries.mac [newsgroup]
  99.  
  100.   V.    One-liners
  101.           1. The Main Loop and Events
  102.           2. Menus
  103.           3. Resources
  104.           4. Windows, Alerts, and Dialogs
  105.           5. Drawing
  106.           6. Files
  107.           7. Interrupts and VBL Tasks
  108.           8. Handles and Pointers
  109.           9. General
  110.  
  111.  
  112. Part Two  (separate file)
  113. -------------------------
  114.  
  115.   VI.   Specific Questions Answered
  116.           1. The Main Loop and Events
  117.                1. How do you tell if a specific key is being pressed?
  118.                2. How can I get millisecond timing from the keyboard
  119.                   (or mouse)?
  120.           2. Menus
  121.                1. When do you put an ellipsis on the end of a menu item?
  122.                2. How do I get the menubar to disappear and re-appear?
  123.                3. What's the difference between the resource ID of a 'MENU'
  124.                   resource and the menuID field of that resource?
  125.           3. Windows, Alerts, and Dialogs
  126.                1. How do you put a border around the default button in a
  127.                   dialog?
  128.           4. Drawing
  129.                1. What is the fastest way to paint one pixel on the screen?
  130.                2. How do you draw directly into a pixmap without using
  131.                   QuickDraw?
  132.                3. How do you draw directly onto the screen without using
  133.                   QuickDraw?
  134.                4. What RGB value does the system use for dimmed buttons,
  135.                   menus and window titles?
  136.           5. Files
  137.                1. Why is the File Manager so hard to use?
  138.                2. How do you get a full pathname?
  139.                3. How do you set the SFGet/PutFile directory?
  140.                4. How do you access the application's data fork?
  141.           6. Handles and Pointers
  142.                1. When should I call MoveHHi?
  143.                2. Why does malloc/calloc keep crashing or returning NULL in
  144.                   Think C?
  145.           7. Standalone Code
  146.                1. How do I write an INIT?
  147.           8. General
  148.                1. How do I register signatures and file types with Apple?
  149.                2. How do I go about writing serial port communications?
  150.  
  151.  
  152.   VII.  Eternal Debates:
  153.           1. Why doesn't the Mac do preemptive multitasking?
  154.  
  155.  
  156.  
  157. =============================================================================
  158.  
  159.  
  160.                      ===================================
  161.                        Section I: Development Software
  162.                      ===================================
  163.  
  164.  
  165. This is by no means a complete analysis of the tools, development systems,
  166. etc. that are available.  This is a short list of things which *most* Mac
  167. programmers use (or are at least aware of, and have considered using).
  168.  
  169.  
  170.  
  171. 1.1  Compilers
  172. --------------
  173.  
  174. Macintosh Programmer's Workshop (Apple)
  175. ---------------------------------------
  176.  
  177. MPW is a package which contains separately-purchaseable compilers for
  178. Assembly, C, C++, and Object Pascal.  All of these run in an environment
  179. called the MPW Shell.  The Shell is a command-line oriented environment,
  180. designed for extreme configurability with scripts, user-writeable "tools",
  181. i/o redirection, and lots of other bells and whistles.  On the pro side, it
  182. can do many things that THINK cannot do; it scales much better to large
  183. projects; it can be customized much more; and it's Apple's supported
  184. development environment.  On the con side, it is comparatively expensive,
  185. slow, and difficult to learn.  A debugger (SADE) is available for it, and
  186. is philosophically similar to MPW.  An object library is available (MacApp)
  187. which allows applications to be built on an object-oriented framework, again
  188. similar to MPW in it's approach of being very powerful, but not necessarily
  189. easy to learn, easy to use, small, or fast.
  190.  
  191. MPW is also available on the quarterly Essentials-Tools-Objects CD-ROM from
  192. Apple.  This disc contains the latest version of the entire MPW development
  193. environment, as well as debugging utilities and a huge collection of sample
  194. source code.  This brings the price of the MPW environment down a bit, but
  195. it's still much more expensive than THINK.
  196.  
  197.  
  198. Think (Symantec)
  199. ----------------
  200.  
  201. Think is two separate products, Think C and Think Object Pascal.  They are
  202. similar products.  Both are integrated editor/compiler/linker/debugger
  203. environments.  Both come with a large library of predefined classes (the C
  204. classes are written in a sort of pseudo C++ language that is Symantec's own
  205. Object C, not C++).  Think Pascal is MacApp-compatable, as well.  Both
  206. support inline assembly, but there is no separate assembler.  Their main
  207. selling point, however, is that they are very fast and very simple.  They are
  208. ideal for small projects that you want to finish in a few days, for
  209. beginners, and for people who need a full-fledged development environment but
  210. cannot afford MPW.  This is not to say that the Think environments are not
  211. useful for commercial development; many successful commercial programs were
  212. written with Think.  The difference in power between MPW and Think is only
  213. noticeable with very large and/or multiple-developer projects.
  214.  
  215.  
  216.  
  217. 1.2  Debuggers (beyond SADE and the Think debuggers)
  218. ----------------------------------------------------
  219.  
  220. MacsBug (Apple)
  221. ---------------
  222.  
  223. MacsBug is an assembly-level debugger.  It is a command-line driven, entirely
  224. text-based environment which uses little of the Mac toolbox, and is thus
  225. fairly stable in crashes (although it doesn't use protected memory, its main
  226. failing in the area of stability).  It supports complex operations with
  227. breakpoints, A-line traps, macros, expressions, and more, and can be
  228. configured even more with user-writeable 'dcmd' external code resources.
  229. MacsBug is free via anonymous ftp from ftp.apple.com.  It is also included
  230. with the book "Debugging Macintosh Software with MacsBug."
  231.  
  232.  
  233. TMON Professional (ICOM)
  234. ------------------------
  235.  
  236. TMON Professional is an object-level debugger which is MUCH more powerful
  237. than MacsBug.  It has an elaborate interface which looks nothing like a Mac
  238. application, and takes a while to get used to.  It is a very intelligent
  239. program, however, which can often display memory in its most useful format
  240. without help (e.g. it will disassemble code, and display a string as a
  241. string, automatically).  It has strong support for types, allowing you to
  242. easily view complex structures, arrays, floating point numbers, and more.
  243. You can examine the stack, the heaps, and just about anything else you could
  244. be interested in.  It also provides versatile scripting, and is amazingly
  245. configurable.  There are more goodies in this package than I can possible
  246. describe here.  Drawbacks are high price, and a very steep learning curve.
  247.  
  248.  
  249. The Debugger (Jasik Designs)
  250. ----------------------------
  251.  
  252. The Debugger (also known as Jasik's Debugger, because it was written by Steve
  253. Jasik) is the only source level debugger with all the low-level features of
  254. Macsbug (speed, straight-forward display of important info) and many of the
  255. advantages of source level debuggers (source code, quick display of local
  256. variables).  Some of its best features are complete support for Object
  257. Pascal, speed, and the ability to look at resource map and file information.
  258. You gotta love any debugger that will display all of the low-level globals
  259. with their values in a single keystroke!  It also has a On the down side,
  260. the interface is an aquired taste, the documentation needs work and
  261. distribution disks lack a certain polish.  But, phone support is very good
  262. (you often get Steve himself).
  263.  
  264.  
  265. SourceBug (Apple)
  266. -----------------
  267.  
  268. SourceBug is provided by Apple on its ETO development-tools CD.  Like SADE,
  269. SourceBug is a source-level debugger.  SADE is a scriptable,
  270. stream-in/stream-out environment like MPW: The code being debugged is
  271. displayed in text windows, with the current line highlighted.  Data
  272. structures
  273. can be inspected, but only through printing commands; the formatting is
  274. automatic and type-sensitive.  And, you can use scripts to walk linked or
  275. array data structures automatically, and save the results to text files.
  276.  
  277. SourceBug, by contrast, is driven by mouse selections and menu commands.  The
  278. program is centered around a browser window that organizes your code by
  279. source
  280. file (or by type, if you are using C++ or Object Pascal) and module name.
  281. You
  282. set breakpoints by clicking next to the line you want to break at.  SADE
  283. requires a command to set breakpoints (though a menu item front-ends a script
  284. to set simple ones by selection); on the other hand, a SADE breakpoint can
  285. execute any script, permitting snapshots and conditional breaks.  SourceBug
  286. gives you only an unconditional break.
  287.  
  288. The same dichotomy applies to data structures:  SourceBug is nearly as smart
  289. as SADE in parsing data, and provides you with an inspector for most
  290. instances
  291. of C++ or Pascal objects.  But finding data, link traversals, and some
  292. formatting are strictly manual jobs.  Variable-length arrays of complex
  293. types?
  294. Forget it.  SADE can handle them, SourceBug can't.
  295.  
  296. For most purposes, SourceBug is the better debugger.  It is rare that you
  297. need
  298. SADE's strengths badly enough to compose the suite of breakpoints and testing
  299. scripts you will need to make SADE effective.  SourceBug is better at 99% of
  300. the debugging tasks:  For instance, when you break into SourceBug, the
  301. currently-executing procedure is displayed in a window, with an arrow
  302. pointing
  303. to the current line.  In the upper part of the window is the stack crawl;
  304. click on any item in the list to see any procedure in the calling chain, see
  305. the line that made the call, and inspect (the optimizer permitting) the local
  306. variables of any procedure in the chain.  To do the same in SADE requires
  307. issuing a command to dump the stack and selecting a code address identifier
  308. in
  309. the result.  To examine a variable in use by a caller, you will have to use
  310. SADE's scoping language to provide it with enough context to identify the
  311. address.  SADE can do more, but it can't carry enough context to be as
  312. helpful
  313. as SourceBug.
  314.  
  315.  
  316.  
  317. 1.3  Other Tools
  318. ----------------
  319.  
  320. ResEdit (Apple)
  321. ---------------
  322.  
  323. ResEdit is the accepted tool for editing and creating resources.  It has very
  324. little competition, partially because it is a very good and comprehensive
  325. program, and partially because it is free (available via anonymous ftp from
  326. ftp.apple.com).  It allows you to edit any resource in hexadecimal, and most
  327. of the standard types have special editors that provide a direct-manipulation
  328. paradigm for editing them.  Users may write their own pickers and editors for
  329. custom resource types, although this is rarely done in practice.
  330.  
  331.  
  332. Resorcerer (Mathemaesthetics)
  333. ------------------------------
  334.  
  335. Resorcerer is a commercially available replacement for ResEdit.  Many
  336. developers use it exclusively, and swear by it quite vehemently.  This is
  337. from one of them:
  338.  
  339.       RESORCERER is a no-holds-barred resource dynamo.
  340.         -- embarrasses the ResEdit dialog editor
  341.         -- supports many more template data types
  342.         -- swap in different resource templates based on a key value
  343.         -- creates recursive resources
  344.         -- generates starter code for a dialog
  345.         -- does complex searches against resource contents or titles
  346.         -- renumbers resources in batches
  347.         -- changes resource types
  348.         -- excellent support from the author himself
  349.  
  350. I personally like Resorcerer for some things and ResEdit for others.  There
  351. are certain resource types that cannot be edited with Resorcerer, like
  352. color icons, and others that cannot be edited with ResEdit, like help
  353. balloons.  I expect, however, that with the addition of such resource
  354. editors to Resorcerer, I will begin to use it exclusively.
  355.  
  356. The price is the major consideration for most people.  ResEdit is free from
  357. Apple, while Resorcerer is a commercial product (available for around $250).
  358.  
  359.  
  360. Virtual User (Apple)
  361. --------------------
  362.  
  363. Virtual User allows you to script user interactions with a program so that
  364. they cal be relayed over and over, and it can execute scripts remotely, over
  365. AppleTalk.  So, for instance, you could write a script that puts your program
  366. through its paces, and then automatically execute that script simultaneously
  367. on lots of differently configured Macintosh systems.  It is available from
  368. APDA (#M0987LL/B).  [This paragraph taken from develop Issue 8, page 60.]
  369.  
  370.  
  371. Online Companion (Addison-Wesley)
  372. ---------------------------------
  373.  
  374. Online Companion is a reference tool.  Hit a magic key combination, and a
  375. pseudo-window opens at the bottom of the screen which allows you to type in
  376. a full or partial name and find it in Online's database.  It contains Inside
  377. Mac and some supplements, Tech Notes, etc.  It's fast and simple.
  378.  
  379.  
  380. Think Reference (Symantec)
  381. --------------------------
  382.  
  383. Think Reference is a reference tool.  It is a hypertext version of Inside Mac
  384. I-V and the Tech Notes.  Click on the function or data type name to go to the
  385. page on which it is defined.  It includes some very useful notes and examples
  386. written by Symantec, and the function prototypes can be copied and pasted
  387. into your editor.  Very fast and simple to use.  But beware of typos and, in
  388. some cases, bad advice.
  389.  
  390.  
  391.  
  392.  
  393.  
  394.                    ========================================
  395.                      Section II: Apple Developer Programs
  396.                    ========================================
  397.  
  398.  
  399. 2.1  The Associates and Partners Programs
  400. -----------------------------------------
  401.  
  402. From the Macintosh Development Tools and Languages Guidebook
  403. (1993 Edition, page 15):
  404.  
  405. The Apple Associates Program is Apple's mainstream program for qualified
  406. commercial developers whose plans are well-aligned to Apple's long-term
  407. strategy.  Members of this program receive essential technical and
  408. marketing information, as well as self-help technical support tools.
  409. Eligible Apple Associates can also purchase, at special prices, a limited
  410. number of Apple systems for development purposes.
  411.  
  412. The Apple Partners Program is a development support program for
  413. Apple-selected commercial developers.  Apple Partners haves access to
  414. programs and services such as techical and marketing information, as well
  415. as direct technical support via electronic mail.  Apple Partners can also
  416. purchase, at special prices, a limited number of Apple computer systems
  417. for development purposes.
  418.  
  419. Apple Associates and Apple Partners receive a monthly mailing containing
  420. all of the information in the Technical Information Mailing.  [see section
  421. 2.4]  Two other particularly interesting products that are included are
  422. the Developer CD, which contains hundreds of megabytes of
  423. programming-related material, and Apple Direct, a newspaper that keeps
  424. developers abreast of Apple's technical developments and marketing
  425. directions.
  426.  
  427. Apple Associates and Apple Partners also get product-level support on
  428. development tools and system software, and information on how to use
  429. Apple's resources most efficiently.  Additionally, code-level support
  430. from Developer Technical Support is available to Apple Partners via
  431. electronic mail.
  432.  
  433. For more information on support programs for commercial developers
  434. contact the Developer Hotline at:
  435.  
  436. Developer Support
  437. Apple Computer Inc.
  438. 20525 Mariani Avenue, M/S 75-2C
  439. Cupertino, CA 95014
  440. (408) 974-4897
  441.  
  442. [no AppleLink address is given, but try DEVSUPPORT]
  443.  
  444.  
  445. 2.2  Apple Developer University
  446. -------------------------------
  447.  
  448. From the back cover of 'develop' Issue 7:
  449.  
  450. Apple Developer University provides training for all levels of Macintosh
  451. programmers.  The hands-on classes give you experience using the most up-
  452. to-date development tools.  Classes are offered in locations across the
  453. United States, and on-site instruction can also be arranged.  Multimedia
  454. self-paced courses are available from Developer University through APDA.
  455. These courses include Macintosh Programming Fundamentals, User-Centered
  456. Design, and Introduction to Object-Oriented Programming.
  457.  
  458. The registrar at (408) 974-6215 can reserve your place or send a current
  459. catalog.  You can also AppleLink DEVUNIV (devuniv@applelink.apple.com) or
  460. write
  461.  
  462.      20525 Mariani Avenue
  463.      M/S 75-6U
  464.      Cupertino, CA  95014
  465.  
  466.  
  467. 2.3  APDA
  468. ---------
  469.  
  470. From the Macintosh Development Tools and Languages Guidebook
  471. (1993 Edition, page 13):
  472.  
  473. APDA is an Apple service organization that offers convenient worldwide
  474. access to over 300 development tools, resources, training products, and
  475. information for anyone interested in developing applications on Apple
  476. platforms.  Customers receive the quarterly APDA Tools Catalog featuring
  477. alll of the most popular and most current versions of Apple tools and the
  478. most popular third-party development tools.  Ordering is easy, there are
  479. no membership fees and no special agreements are required for most products.
  480. APDA offers convenient payment and shipping options, including site
  481. licensing.
  482.  
  483. To order product or receive a complimentary APDA Tools Catalog, contact:
  484.  
  485.     APDA
  486.     Apple Computer Inc.
  487.     P.O. Box 319
  488.     Buffalo, New York 14207-0319 U.S.
  489.  
  490.     (800) 282-2732 U.S.
  491.     (800) 637-0029 Canada
  492.     (716) 871-6555 International
  493.     (716) 871-6511 Fax
  494.     APDA           AppleLink (apda@applelink.apple.com)
  495.     76666,2405     CompuServe
  496.     APDA           America Online
  497.  
  498.  
  499. 2.4  Developer CDs
  500. ------------------
  501.  
  502. The developer CDs are available quarterly from APDA, or monthly to Apple
  503. Associates and Partners.  The quarterly version is also included in the
  504. quarterly issue of d e v e l o p.  They contain just about everything that
  505. Apple makes freely available, including SpInside Mac, the Tech Notes, and
  506. a plethora of code snippets.
  507.  
  508.  
  509.  
  510.  
  511.  
  512.                    =======================================
  513.                      Section III: Sources of Information
  514.                    =======================================
  515.  
  516.  
  517. 3.1  Books and Periodicals
  518. --------------------------
  519.  
  520. 3.1.1  Technical Books
  521. ----------------------
  522.  
  523.  
  524. Inside Macintosh Volume I
  525.    Addison-Wesley.  ISBN 0-201-17731-5.  $24.95
  526. Inside Macintosh Volume II
  527.    Addison-Wesley.  ISBN 0-201-17732-3.  $24.95
  528. Inside Macintosh Volume III
  529.    Addison-Wesley.  ISBN 0-201-17733-1.  $19.95
  530. Inside Macintosh Volume IV
  531.    Addison-Wesley.  ISBN 0-201-05409-4.  $24.95
  532. Inside Macintosh Volume V
  533.    Addison-Wesley.  ISBN 0-201-17719-6.  $26.95
  534. Inside Macintosh Volume VI
  535.    Addison-Wesley.  ISBN 0-201-57755-0.  $39.95
  536.  
  537.      Inside Mac is the definitive reference regarding the Macintosh toolbox.
  538.      Volumes I and II are basically essential to any Mac programmer who uses
  539.      the toolbox at all.  Volume III is essentially a summary, cross
  540.      reference, index-y sort of thing, and isn't very useful.  Volume IV is
  541.      stuff specific to the Mac Plus and later machines, which would make it
  542.      almost as important as I and II (not many 512K Macs left out there),
  543.      except that the routines it describes are not nearly as generally
  544.      useful.  It does have all of the stuff on the HFS File Manager, however,
  545.      so if you're working with File Manager routines you should definitely
  546.      consult IV before I-III.  Otherwise, you can survive without it for a
  547.      while.  Volume V is the Mac II volume.  It has every thing on Color
  548.      QuickDraw, as well as lots of other goodies.  I'd say it's more useful
  549.      than IV, but only if you're doing color.  Volume VI is the System 7
  550.      volume.  It contains all kinds of bizarre new things which are probably
  551.      not of general use or interest; but it contains a lot of new
  552.      non-System-7 stuff as well (such as 32-bit Quickdraw), and it has
  553.      corrections to the other five volumes.
  554.  
  555.  
  556. Inside Macintosh X-Ref, Revised Edition
  557.    Addison Wesley.  ISBN 0-201-57769-0.  $12.95.
  558.  
  559.      Inside Mac X-Ref is a cross-referenced index to the six volumes and
  560.      some other Macintosh technical books.
  561.  
  562.  
  563. Inside Macintosh: Files      ISBN 0-201-63244-6     $29.95
  564. Inside Macintosh: Memory     ISBN 0-201-63240-3     $24.95
  565. Inside Macintosh: Processes  ISBN 0-201-63241-1     $22.95
  566.  
  567.      Inside Macintosh, having previously been three authoritative
  568.      volumes, with three chronological supplements, has been due for
  569.      a rewrite and overhaul for a few years.  Apple is now in the
  570.      process of reissuing IM in 15 subject-related books, of which
  571.      only the first three have come out at this writing.
  572.  
  573.      If you have volumes I-VI, then you will eventually have to buy
  574.      the new Inside Macintosh, too.  Newcomers are in a dilemma:
  575.      The new IM has better information than the old one, but not
  576.      enough of the new IM has come out to be useful.  They will have
  577.      to judge how urgent their need is for authoritative
  578.      information.  Dabblers and beginners can probably get by with
  579.      the teaching books recommended below.  Serious work begins with
  580.      Volume I (basic ToolBox), Volume II (basic OS), and Volume IV
  581.      (for the file system).  If you need color, get Volume V; if you
  582.      do anything with processes (IPC, backgrounding), get Volume VI.
  583.  
  584.  
  585. M68000 User's Manual
  586.    Prentice Hall.  ISBN 0-13-609249-7.  $22.95.
  587. MC68020 User's Manual
  588.    Prentice Hall.  ISBN 0-13-567017-9.  $22.95.
  589. MC68030 User's Manual
  590.    Prentice Hall.  ISBN 0-13-566423-3.  $22.95.
  591. MC68881/MC68882 Floating-Point Coprocessor User's Manual
  592.    Prentice Hall.  ISBN 0-13-566936-7.  $22.95.
  593.  
  594.      The Motorola references are required reading for anyone doing assembly
  595.      programming on the Mac.  The 68000 is by far the most important.  The
  596.      68881 manual only has relevance to those who want to do floating point
  597.      and don't want to use SANE (the Standard Apple Numeric Environment,
  598.      slow but robust, precise and general).
  599.  
  600.  
  601. Technical Introduction to the Macintosh Family
  602.    Addison-Wesley.  ISBN 0-201-17765-X.  $19.95.
  603.  
  604.      This book provides an overview of the general hardware design, system
  605.      archiecture, and ROM design of the Macintosh.  It is not required for
  606.      programming, but does provide some useful background information for
  607.      programmers new to the Mac.
  608.  
  609.  
  610. Programmer's Introduction to the Macintosh Family.
  611.    Addison-Wesley.  ISBN 0-201-19254-3.  $22.95.
  612.  
  613.      This book provides an overview of basic Macintosh programming concepts.
  614.      It is recommended for programmers new to the Mac.
  615.  
  616.  
  617. Guide to the Macintosh Family Hardware
  618.    Addison-Wesley.  ISBN 0-201-52405-8.  $26.95.
  619.  
  620.      This is the definitive guide to the hardware design of the Macintosh
  621.      family.
  622.  
  623.  
  624. Designing Cards and Drivers for the Macintosh Family
  625.    Addison-Wesley.  ISBN 0-201-52404-X.  $26.95.
  626.  
  627.      This is the official guide for developers of expansion cards and
  628.      peripheral devices for the Mac.  This book is required reading for
  629.      anyone who wants to talk directly to expansion cards (video cards,
  630.      for example).
  631.  
  632.  
  633. Human Interface Guidelines: The Apple Desktop Interface
  634.    Addison-Wesley.  ISBN 0-201-17753-6.  $14.95.
  635.  
  636.      This is the definitive guide to program interface design on the
  637.      Macintosh.  When you find yourself wondering where to put the OK
  638.      button in a dialog, consult this book.
  639.  
  640.  
  641. Apple Numerics Manual
  642.    Addison-Wesley.  ISBN 0-201-17738-2.  $29.95.
  643.  
  644.      This book describes the Standard Apple Numerics Environment (SANE),
  645.      and provides information about the IEEE-standard arithmetic and
  646.      about the SANE engines on the Apple IIgs and Macintosh computers.
  647.  
  648.  
  649. Inside the Macintosh Communications Toolbox
  650.    Addison-Wesley.  ISBN 0-201-57775-5.  $24.95.
  651.  
  652.      This is the definitive reference volume for the Communications Toolbox.
  653.  
  654.  
  655.  
  656. 3.1.2  Teaching Books
  657. ---------------------
  658.  
  659.  
  660. Macintosh Programming Primer (Second Edition)
  661.    Addison-Wesley.  ISBN 0-201-60838-3.  $26.95.
  662. Macintosh C Programming Primer Volume II
  663.    Addison-Wesley.  ISBN 0-201-57016-5.  $24.95.
  664.  
  665.      These are excellent books for the beginning Mac programmer.  Both books
  666.      use Think C in their examples, but developers using other platforms
  667.      will find a plethora of useful tidbits.  I believe both books are
  668.      available in Pascal as well.
  669.  
  670.  
  671. Macintosh Revealed, Volume One: Unlocking the Toolbox
  672.    Hayden Books.  ISBN 0-8104-6551-5.  $26.95.
  673. Macintosh Revealed, Volume Two: Programming with the Toolbox
  674.    Hayden Books.  ISBN 0-8104-6561-2.  $26.95.
  675. Macintosh Revealed, Volume Three: Mastering the Toolbox
  676.    Hayden Books.  ISBN 0-672-48402-1.  $26.95.
  677. Macintosh Revealed, Volume Four: Expanding the Toolbox
  678.    Hayden Books.  ISBN 0-672-48413-7.  $26.95.
  679.  
  680.      This encyclopedic collection covers the entire Mac Toolbox for the
  681.      beginning Pascal or Assembly programmer.  It sometimes re-iterates
  682.      Inside Mac, but always offers a fresh perspective.  Volume I covers
  683.      basics including memory management and QuickDraw.  Volume II covers the
  684.      other essential Toolbox managers and exemplifies each by constructing
  685.      part of a complete text editor.  Volume III expands this application,
  686.      covering printing, drivers, desk accessories, sound and definition
  687.      functions.  Volume IV contains details of programming with MultiFinder,
  688.      Color QuickDraw and styled text.
  689.  
  690.  
  691. How to Write Macintosh Software (Third Edition)
  692.    Hayden Books.  ISBN 0-201-?????-?.  ~$30.
  693.  
  694.      This book gives comprehensive coverage of memory management and
  695.      debugging techniques.  It also gives an excellent overview of assembly
  696.      language programming on the Mac.  A must-have.  Somebody please send me
  697.      the ISBN and price of the third edition (I haven't bought mine yet).
  698.  
  699.  
  700. Macintosh Programming Secrets (Second Edition)
  701.    Addison-Wesley.  ISBN 0-201-58134-5.  $29.95.
  702.  
  703.      This is the second edition of Scott Knaster's classic book.  This
  704.      edition was co-authored by Keith Rollin.  From the back cover: "If
  705.      you've ever written Macintosh programs, or want to learn how it's done,
  706.      this book will show you how to perform tasks that aren't explicitly
  707.      documented in the reference books."  This is true.  Get this book if
  708.      you want to learn how to write a tail patch, or how to hide the menu
  709.      bar.  If you don't know what a tail patch is, that's OK; this book
  710.      starts at (or near) the beginning.  A must-have for all beginning- and
  711.      intermediate-level Macintosh programmers.
  712.  
  713.  
  714. On Macintosh Programming: Advanced Techniques
  715.    Addison-Wesley.  ISBN 0-201-51737-X.  $24.95.
  716.  
  717.      This book contains a lot of information on all aspects of programming
  718.      the Mac, including hardware and software architecture, the toolbox,
  719.      and the use of assembly, C, and Pascal for programming the toolbox.
  720.      It includes quite a lot of source code.
  721.  
  722.  
  723. Using the Macintosh Toolbox With C
  724.    Sybex.  ISBN 0-89588-572-7.  $29.95.
  725.  
  726.      This is a fairly good book for beginning Mac programmers.  Experienced
  727.      programmers will find nothing new here.
  728.  
  729.  
  730. Programmer's Guide to MPW, Volume I
  731.    Addison-Wesley.  ISBN 0-201-57011-4.  $26.95.
  732.  
  733.      This is a basic introduction to using MPW.  I don't recommend it for
  734.      anyone who already uses MPW.
  735.  
  736.  
  737. Programming with MacApp
  738.    Addison-Wesley.  ISBN 0-201-09784-2.  $24.95.
  739. C++ Programming with MacApp
  740.    Addison-Wesley.  ISBN 0-201-57020-3.  $24.95.
  741.  
  742.      These give a basic introduction to programming with MacApp; the first
  743.      with Object Pascal, and the second with C++.
  744.  
  745.  
  746. Programming for System 7.
  747.    Addison-Wesley.  ISBN 0-201-56770-9.  $26.95
  748.  
  749.      This is a guide to creating applications for System 7.  It describes
  750.      the new features and functions of the operating system in detail.
  751.      The sample code is in C and includes a complete System 7 application
  752.      in Chapter 1 which is expanded in succeeding chapters.
  753.  
  754.  
  755. ResEdit Complete
  756.    Addison-Wesley.  ISBN 0-201-55075-X.  $29.95.
  757.  
  758.      Most of this book is not written for programmers, but includes quite
  759.      a bit of useful information nonetheless.  It contains detailed
  760.      discussions of using, customizing and programming ResEdit, including
  761.      the creation of custom templates, pickers and editors. It comes with
  762.      ResEdit 2.1 on disk, with sample source code in MPW C and Pascal.
  763.  
  764.  
  765. Debugging Macintosh Software with MacsBug
  766.    Addison-Wesley.  ISBN 0-201-57049-1.  $34.95.
  767.  
  768.      This looks like a really good and useful book, but I haven't had a
  769.      chance to look at it yet.  MacsBug is included on disk, along with
  770.      several examples and dcmds.
  771.  
  772.  
  773. Programming the M68000
  774.    Benjamin/Cummings.  ISBN 0-8053-5550-2.
  775. 680x0 Programming by Example
  776.    Howard W. Sams & Co.  ISBN 0-672-22544-1.  $17.95.
  777. M68000 Assembly Language: Techniques for Building Programs
  778.    Addison-Wesley.  ISBN 0-201-11659-6.
  779. The Complete Book of Macintosh Assembly Language Programming [sic]
  780.    Scott, Foresman & Co.
  781.    Vol I  ISBN 0-673-18379-3
  782.    Vol II ISBN 0-673-18583-4
  783.  
  784.      These are all assembly books that have been recommended by people on
  785.      the net.  The first two are general; the others are specific to the
  786.      Macintosh.
  787.  
  788.  
  789.  
  790. 3.1.3  Periodicals
  791. ------------------
  792.  
  793.  
  794. d e v e l o p
  795.    Quarterly.  $10 per issue.  $30 per year.
  796.    develop
  797.    Apple Computer, Inc.
  798.    P.O. Box 531
  799.    Mt. Morris, IL  61054
  800.    AppleLink DEV.SUBS
  801.  
  802.      develop is Apple's technical journal for the Macintosh and Apple II
  803.      (the focus is on the Mac).  The articles are well-written and useful,
  804.      and it includes the Developer CD.
  805.  
  806.  
  807. MacTech  (was MacTutor)
  808.    Monthly.  $5 per issue.  $40 per year Third Class; $55 First Class.
  809.     Xplain Corporation
  810.     P.O. Box 250055
  811.     Los Angeles, CA  90025-9555
  812.     Phone: (310) 575-4343
  813.       FAX: (310) 575-0925
  814.     mactutor@applelink.apple.com
  815.  
  816.      The only Macintosh programming journal that I'm aware of.  A good
  817.      source of sample code.
  818.  
  819.  
  820.  
  821.  
  822. 3.2  Mailing Lists
  823. ------------------
  824.  
  825. 3.2.1  Comp.Sys.Mac.Programmer Digest
  826. -------------------------------------
  827.  
  828. The Comp.Sys.Mac.Programmer Digest is a collection of article threads from
  829. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  830. regularly and want an archive of the discussions.
  831.  
  832. Each issue of the digest contains one or more sets of articles (called
  833. threads), with each set corresponding to a 'discussion' of a particular
  834. subject.  The articles are not edited; all articles included in the digest
  835. are in their original posted form (as received by the news server at
  836. cs.uoregon.edu).  Article threads are not added to the digest until the last
  837. article added to the thread is at least one month old (this is to ensure that
  838. the thread is dead before adding it to the digest).  Article threads that
  839. consist of only one message are generally not included in the digest.
  840.  
  841. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  842. [128.223.8.8] in the directory /pub/mac/csmp-digest.  The most recent issues
  843. are available from sumex-aim.stanford.edu [36.44.0.6] in the directory
  844. /info-mac/digest/csmp.  If you don't have ftp capability, the sumex archive
  845. has a mail server; send a message with the text '$MACarch help' (no quotes)
  846. to LISTSERV@ricevm1.rice.edu for more information.
  847.  
  848. The digest is also available via email.  Just send a note saying that you
  849. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  850. automatically receive each new issue as it is created.  Sorry, back issues
  851. are not available through the mailing list.
  852.  
  853.  
  854.  
  855.  
  856. 3.2.2  Think Class Library Discussion
  857. -------------------------------------
  858.  
  859. The Think Class Library discussion list is for those interested in using
  860. Symantec's Think C and Think Pascal object-oriented class library for
  861. Macintosh.  Discussion topics include
  862.  
  863.    * class usage, design, and implementation
  864.    * TCL bug reports, work-arounds, and fixes
  865.    * TCL application development techniques
  866.    * TCL development aids
  867.  
  868. Mail to the discussion list should be sent to tcl-talk@brown.edu.
  869. If you want to join the discussion list, mail a note saying so to
  870. tcl-request@brown.edu.
  871.  
  872.  
  873.  
  874.  
  875. 3.2.3  MacPsych
  876. ---------------
  877.  
  878. This is a mailing list of psychologists and others interested in using the
  879. Macintosh in research and teaching.  The intention of this service is to
  880. provide quick and authoritative answers to questions raised by Mac-using
  881. researchers and teachers in psychology.  Individuals who have Mac questions
  882. to pose, or have general messages that they believe would be of interest to
  883. research psychologists and teachers using the Macintosh, may send their
  884. information to macpsych@stolaf.edu.  Mail sent to this address will first
  885. pass through the moderator for the list (huff@stolaf.edu) who will forward
  886. it to everyone on the list.
  887.  
  888. If you want to be on the mailing list, mail a note saying so to
  889. macpsych-request@stolaf.edu.
  890.  
  891. There is an archive containing some free Macintosh software that has been
  892. written by members of the group; for more information, write to
  893. macpsych-request@stolaf.edu.
  894.  
  895.  
  896.  
  897.  
  898. 3.3  Miscellaneous
  899. ------------------
  900.  
  901. 3.3.1  Usenet Mac Programmer's Guide
  902. ------------------------------------
  903.  
  904. The Usenet Mac Programmer's Guide (UMPG) is a collection of useful tips
  905. culled  from comp.sys.mac.programmer.  Compiled by Matthew X. Mora
  906. (mxmora@unix.sri.com), it is organized by topic and includes a table of
  907. contents and index.  It is available via anonymous ftp from sumex-aim.
  908. stanford.edu (36.44.0.6) in the directory /info-mac/tech/.
  909.  
  910. It is also available in a pre-printed version, or on disk.
  911.  
  912. To get a copy of the printed version send $17.00 to:
  913.  
  914.      USENET Macintosh Programmer's Guide Printed Version
  915.      39075 Carmel Ct.
  916.      Fremont, CA  94538
  917.  
  918. To get a copy of the disk version send $5.00 to:
  919.  
  920.       USENET Macintosh Programmer's Guide Disk Version
  921.       39075 Carmel Ct.
  922.       Fremont, CA  94538
  923.  
  924.  
  925.  
  926.  
  927. 3.3.2  Kent Sandvik's Frequently Asked MPW C++ and MacApp Questions
  928. -------------------------------------------------------------------
  929.  
  930. This file is available upon request from ksand@apple.com or via anonymous ftp
  931. to ftp.cs.uoregon.edu [128.223.8.8] in the directory /pub/mac.
  932.  
  933.  
  934.  
  935.  
  936. 3.3.3  Comp.Sys.Mac.FAQ
  937. -----------------------
  938.  
  939. This Frequently Asked Questions list provides short answers to a number of
  940. frequently asked questions from the newsgroups comp.sys.mac.system,
  941. comp.sys.mac.misc, and comp.sys.mac.apps.  Some of the questions that it
  942. answers are asked occasionally on comp.sys.mac.programmer.  Please read
  943. this FAQ list before posting to c.s.m.p.  It is available from the sumex
  944. archives and its mirror sites (see section 4.2) in the file /info-mac/
  945. report/csmf-faq.txt.
  946.  
  947.  
  948.  
  949.  
  950.  
  951.                         =============================
  952.                           Section IV: Archive Sites
  953.                         =============================
  954.  
  955.  
  956. 4.1  ftp.apple.com [130.43.2.3]
  957. -------------------------------
  958.  
  959. Contents
  960.    This archive contains just about everything available for free from
  961.    Apple.  Look here first for sample source code, the latest tech
  962.    notes, and tools such as ResEdit and MacsBug.  Very little of what
  963.    can be found here is available from other archives.
  964.  
  965. Access
  966.    Anonymous ftp, from inside the United States only.
  967.    You should read the file /dts/README.FIRST before downloading from this
  968.    archive.  Everything for the Mac is in /dts/mac.  The moderators ask that
  969.    you download during the off-peak hours if at all possible, since this is
  970.    just a IIci running A/UX.
  971.  
  972. Submissions
  973.    You cannot post to this archive.
  974.  
  975.  
  976. 4.2  sumex-aim.stanford.edu [36.44.0.6]
  977. ---------------------------------------
  978.  
  979. Contents
  980.    This archive contains a large collection of public-domain and shareware
  981.    for the Mac.  It is well-maintained and updated regularly.  New
  982.    submissions to the archive are listed every other day or so in the
  983.    newsgroup comp.sys.mac.digest.
  984.  
  985. Access
  986.    Anonymous ftp.  Read the files in /info-mac/help for more detailed
  987.    information about the files in the archive.  Everything is in /info-mac.
  988.    If you don't have ftp access you can use the mail server; send a message
  989.    with the text '$MACarch help' (no quotes) to LISTSERV@ricevm1.rice.edu
  990.    for more information.
  991.  
  992. Submissions
  993.    Sumex accepts all submissions that "are of general benefit to the
  994.    Macintosh community."  Basically, if you have something that you think is
  995.    useful, and that other people may like to have, you should feel free to
  996.    send it to sumex.  All submissions should be compressed and BinHexed, and
  997.    should include a short but informative blurb at the beginning of the file.
  998.    Mail your submissions to info-mac@sumex-aim.stanford.edu.  For more
  999.    detailed information, consult the file
  1000.        /info-mac/help/posting-guidelines.txt.
  1001.  
  1002.  
  1003. 4.3  rascal.ics.utexas.edu [128.83.138.20]
  1004. ------------------------------------------
  1005.  
  1006. This archive is being discontinued as of 5/92.  It will continue to have
  1007. stuff available for a while, perhaps a few months, but the contents will
  1008. eventually dwindle until there is very little or nothing left.
  1009.  
  1010. Contents
  1011.    This archive contains most of what can be found at sumex.  Its
  1012.    emphasis is on utilities and programming-related items, but it
  1013.    contains quite a bit of other stuff as well.  It is the home of
  1014.    the comp.sys.mac.announce archives.  Many items tend to appear
  1015.    here before they show up at sumex or comp.binaries.mac.
  1016.  
  1017. Access
  1018.    Anonymous ftp.
  1019.  
  1020. Submissions
  1021.    No longer accepted.
  1022.  
  1023.  
  1024. 4.4  mac.archive.umich.edu [141.211.164.153]
  1025. --------------------------------------------
  1026.  
  1027. Contents
  1028.    I haven't explored this archive yet, but I hear it has quite a bit
  1029.    of general Macintosh freeware and shareware.
  1030.  
  1031. Access
  1032.    Anonymous ftp.
  1033.  
  1034. Submissions
  1035.    You can submit to this archive by mailing a compressed, binhexed
  1036.    file with a brief descriptive header to macgifts@mac.archive.umich.
  1037.    edu.  This address will also forward your mail to comp.binaries.mac
  1038.    and sumex-aim.stanford.edu.
  1039.  
  1040.  
  1041. 4.5  ftp.cs.uoregon.edu [128.223.8.8]
  1042. -------------------------------------
  1043.  
  1044. Contents
  1045.    This is the home of this FAQ list, as well as the Comp.Sys.Mac.
  1046.    Programmer Digests.  There's also a little sample code not included
  1047.    in the FAQ.
  1048.  
  1049. Access
  1050.    Anonymous ftp.  Directory /pub/mac.
  1051.  
  1052. Submissions
  1053.    Not accepted.
  1054.  
  1055.  
  1056. 4.6  ics.uci.edu [128.195.1.1]
  1057. ------------------------------
  1058.  
  1059. Contents
  1060.    This archive has some Mac stuff, although not nearly as much as the
  1061.    major sites, such as sumex.  The main attraction is the Think C
  1062.    directory.  It contains the latest updates to Think C, as well as
  1063.    Think C related system extensions, fkeys, etc., and source code.
  1064.    Definitely worth checking out if you use Think C extensively.
  1065.  
  1066. Access
  1067.    Anonymous ftp.  Directory /mac.
  1068.  
  1069. Submissions
  1070.    Not accepted, I think.  Someone please correct me if I'm wrong.
  1071.  
  1072.  
  1073. 4.7  ftp.brown.edu [128.148.176.55]
  1074. -----------------------------------
  1075.  
  1076. Contents
  1077.    This is the home of the Think Class Library mailing list.  It includes
  1078.    TCL bug fixes and new classes, as well as an archive of the tcl-talk
  1079.    mailing list.
  1080.  
  1081. Access
  1082.    Anonymous ftp.  Directory /pub/tcl.
  1083.  
  1084. Submissions
  1085.    Submissions to the archive should be mailed to tcl-request@brown.edu or
  1086.    placed in the directory /incoming/tcl with accompanying mail to
  1087.    tcl-request.  Encode all submissions in BinHex 4.0 format and include a
  1088.    descriptive header.  Please do not redistribute Symantec's TCL source.
  1089.  
  1090.  
  1091. 4.8  comp.binaries.mac [newsgroup]
  1092. ----------------------------------
  1093.  
  1094. Contents
  1095.    This is a moderated newsgroup for distribution of Macintosh freeware
  1096.    and shareware.  Just about everything that gets sent to sumex and
  1097.    the other major archives gets sent here as well.
  1098.  
  1099. Access
  1100.    Subscribe to the newsgroup....
  1101.  
  1102. Submissions
  1103.    All files should be compressed and binhexed for mailing.  Posting
  1104.    to the newsgroup should automatically get your file mailed to the
  1105.    moderator.  If this does not happen on your system, you can mail
  1106.    your posting to the moderator yourself at macintosh@dhw68k.cts.com,
  1107.    or at dhw68k!bytebug@ics.uci.edu if the first address doesn't work.
  1108.    Expect a delay of as much as a month before your posting shows up
  1109.    on the newsgroup.
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.                           =========================
  1116.                             Section V: One-liners
  1117.                           =========================
  1118.  
  1119.  
  1120. 5.1  The Main Loop and Events
  1121. -----------------------------
  1122.  
  1123. Call MaxApplZone and MoreMasters when the application starts up.
  1124. If you call SetApplLimit, do it before calling MaxApplZone.
  1125. Use HD in MacsBug while running to estimate how many times to call
  1126. MoreMasters.
  1127. Don't use SetEventMask to disable mouseUp events.  Better not to use it at
  1128. all.
  1129. Call WaitNextEvent if you're running under System 6 or later.
  1130. DTS sample code passes 0x7fffffff to WaitNextEvent when nothing is happening.
  1131. DTS sample code passes GetCaretTime() to WaitNextEvent when flashing a
  1132. cursor.
  1133. Call both GetNextEvent and SystemTask only if WaitNextEvent is unavailable.
  1134. Call IsDialogEvents and DialogSelect even if GetNextEvent returns false.
  1135. SetPort to a known good grafPort once every time through the event loop.
  1136. Set the cursor on suspend and resume events.
  1137. Call GetDblTime to get the maximum time for a double click.
  1138. Measure double click time from mouse up to mouse down.
  1139.  
  1140.  
  1141. 5.2  Menus
  1142. ----------
  1143.  
  1144. Use SetItem to include meta characters literally in menus.
  1145. Prepend an ASCII 0 to a menu item to use a leading '-'.
  1146. Never make MENU resources purgeable.
  1147.  
  1148.  
  1149. 5.3  Resources
  1150. --------------
  1151.  
  1152. GetResource never produces resNotFound.  Check for a NIL handle instead.
  1153. To create a resource file, call HCreate, then HCreateResFile.
  1154. To open a resource file read-only for shared access, use HOpenResFile.
  1155. Don't leave ResLoad set to false.
  1156. GetResource on a dctb may return a non-resource copy of the dctb.
  1157.  
  1158.  
  1159. 5.4  Windows, Alerts, and Dialogs
  1160. ---------------------------------
  1161.  
  1162. Move and size windows to the bounding box of GetGrayRgn.
  1163. Hide scroll bars when deactivating a window.
  1164. Call DrawGrowIcon when activating or deactivating a window with a grow
  1165. region.
  1166. DrawGrowIcon does not check to see if the window has a grow region.
  1167. Call PenNormal before calling DrawGrowIcon.
  1168. itemHit will not be set when a dialog filter is called.
  1169. Use a disabled UserItem to draw the roundrect outline around the OK button.
  1170. ModalDialog assumes the dialog is already visible and in the front.
  1171. Use screenBits.bounds to center dialogs, alerts, etc. below the menu bar.
  1172. If you save window locations in files, they may not be valid for all
  1173. monitors.
  1174. DragWindow expects startPt in boundsRect; if not it may not call
  1175. SelectWindow.
  1176. SelectWindow does not automatically call SetPort.  You must do that yourself.
  1177. DialogSelect responds to activate events but ignores suspend/resume events.
  1178.  
  1179.  
  1180. 5.5  Drawing
  1181. ------------
  1182.  
  1183. Always set the VisRgn and ClipRgn of offscreen ports.
  1184. Set the ClipRgn first when making a picture.
  1185. Don't make rowBytes in bitMaps greater than 8191.
  1186. To dim text, draw a rectangle with penPat=gray and penMode=patbic over it.
  1187. To draw rotated text, draw to an offscreen bitmap, rotate it, and CopyBits
  1188. it.
  1189. Don't use picSize to determine the size of a picture.  Check the handle size.
  1190. Never draw outside a window except in XOR mode for temporary effects like
  1191. drag.
  1192. To avoid animation flicker, synchronize drawing to the vertical retrace.
  1193. CopyBits on more than 3Kb data will work, but it might have to allocate
  1194. memory.
  1195. The small Mac screen is 512 pixels wide by 342 pixels high including menu
  1196. bar.
  1197.  
  1198.  
  1199. 5.6  Files
  1200. ----------
  1201.  
  1202. Don't write in the application file.  This will fail with read-only devices.
  1203. Use PBGetVInfo to convert a VRefNum to a volume name.
  1204. Delete uses the Poor Man's Search Path, so don't delete blindly.
  1205. File Manager routines with dirID=0 use the Poor Man's Search Path.
  1206. Truncate and reallocate files before overwriting to reduce fragmentation.
  1207. Check/change the creator and type of Save As... files before overwriting.
  1208. If you rewrite files by deleting and creating, copy all Finder information.
  1209. Directory ID's are longs, not shorts.  Shorts work ALMOST all the time.
  1210. Always set the version number that appears in some file manager calls to 0.
  1211. To convert a pathRefNum to a name or file number, use PBGetFCBInfo.
  1212. Prevent the creation of files with names that begin with a period.
  1213.  
  1214.  
  1215. 5.7  Interrupts and VBL Tasks
  1216. -----------------------------
  1217.  
  1218. Don't call any Memory Manager routines during an interrupt.
  1219. Unlocked handles may not be valid during an interrupt.
  1220. To synchronize to the vertical retrace on Macs with slots use SlotVInstall.
  1221.  
  1222.  
  1223. 5.8  Handles and Pointers
  1224. -------------------------
  1225.  
  1226. Lock handles before passing their dereferenced pointers to any routine.
  1227. Lock handles before setting referenced data to expressions containing
  1228. functions
  1229. Put an odd long at location zero on a 68000 to help find NIL handle
  1230. references.
  1231. Use HGetState/HLock/HSetState to lock a handle then put it back as it was.
  1232.  
  1233.  
  1234. 5.9  General
  1235.  
  1236. Always use unsigned characters within text and Pascal-format strings.
  1237. Save application preferences in a folder named Preferences in the System
  1238. Folder
  1239. Use SysEnvirons to find the System (Blessed) Folder.
  1240. Use GetAppParms to get the name of the application.
  1241. The high bit of SysParam . volClik enables the alarm clock.
  1242. Check the application name at $910 before exiting with ES within MacsBug.
  1243. To exit to shell in the mini-debugger, enter SM 0 A9 F4 and then G 0.
  1244. In Pascal, don't nest procedures to be passed by procedure pointer.
  1245. In Pascal, "with theHandle^^" is unsafe if memory compaction can occur.
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.                        ==============================
  1252.                          Credits / Acknowledgements
  1253.                        ==============================
  1254.  
  1255.  
  1256. Many thanks to Ben Haller, who started this whole thing, and did quite a lot
  1257. of work on this posting before handing it off to Michael A. Kelly.  Many
  1258. thanks to Michael A. Kelly also, for all his work in establishing and
  1259. maintaining this FAQ (in addition to continuing to keep the
  1260. Comp.Sys.Mac.Programmer Digest) before passing the baton.
  1261.  
  1262. Thanks to these people for proofreading this list during its development:
  1263.     Ben Haller
  1264.     Wally Wedel
  1265.     John B. Matthews
  1266.     Patrick Beard
  1267.     Steve Zellers
  1268.  
  1269. Thanks to Chris Webster for the one-liners.
  1270.  
  1271. Thanks to Peter Lewis for the answers to the following specific questions:
  1272.     6.2.1  When do you put an ellipsis on the end of a menu item?
  1273.     6.5.1  Why is the File Manager so hard to use?
  1274.     6.5.2  How do you get a full pathname?
  1275.     6.5.3  How do you set the SFGet/PutFile directory?
  1276.  
  1277. Thanks to Greg Ferrar for the review on TMON Pro.
  1278.  
  1279. Thanks to John Rinaldo for the review on Jasik's Debugger.
  1280.  
  1281. Thanks for Fritz Anderson for his descriptions of SourceBug and the new
  1282. Inside Macintosh volumes.
  1283.  
  1284. And thanks to everyone who has offered suggestions or constructive
  1285. criticism....  Keep those comments coming!
  1286.  
  1287.  
  1288.  
  1289.   
  1290.  
  1291.                  ===========================================
  1292.                    Section VI: Specific Questions Answered
  1293.                  ===========================================
  1294.  
  1295.  
  1296.  
  1297. 6.1  The Main Loop and Events
  1298. -----------------------------
  1299.  
  1300.  
  1301. ----------------------------------------------------------
  1302. 6.1.1  How do you tell if a specific key is being pressed?
  1303. ----------------------------------------------------------
  1304.  
  1305. Use GetKeys.  GetKeys fills a 16-byte KeyMap structure with the state of
  1306. every key.  Each bit represents a single key on the keyboard; 1 means the
  1307. key is down, 0 means it is up.  Note that there can be a maximum of seven
  1308. keys being pressed at a time - any of the modifier keys plus at most two
  1309. other keys.
  1310.  
  1311. Here's an example in C:
  1312.  
  1313. Boolean IsKeyDown(
  1314.     unsigned short theKey )  // a keyboard-specific scan code for a key
  1315. {
  1316.  
  1317.     unsigned char  keyMap[16];
  1318.  
  1319.     GetKeys( (void *) keyMap );
  1320.     return ((keyMap[theKey>>3] >> (theKey & 7)) & 1);
  1321.  
  1322. }
  1323.  
  1324.  
  1325.  
  1326. -----------------------------------------------------------------------------
  1327. 6.1.2  I'm writing a psychology experiment.  How can I get millisecond timing
  1328.        from the keyboard (or mouse)?
  1329. -----------------------------------------------------------------------------
  1330.  
  1331. The simple answer is that you can't.  Although the new time manager can call
  1332. routines every couple of microseconds, input goes through the event manager,
  1333. which only posts events about every 16 milliseconds.  Thus, even if you poll
  1334. the keyboard every 30 microseconds, you will not get better than 16 ms.
  1335. resolution.  If you really need millisecond accuracy, you need to use
  1336. external hardware.
  1337.  
  1338. The good news is that you probably don't need better than 16 ms. resolution
  1339. anyway.  Measuring with 16 ms. accuracy only increases the standard deviation
  1340. of your RT means by about 4.8 msec.  Read: Ulrich, R. and Giray, M. (1989).
  1341. Time resolution of clocks: Effects on reaction time measurement -- Good news
  1342. for bad clocks.  British Journal of Mathematical and Statistical Psychology,
  1343. 42, 1-12.
  1344.  
  1345. By the way, there is a mailing list dedicated to running psychology
  1346. experiments on the Mac.  It frequently gets tied up in arguments about
  1347. millisecond timing.  The address to write to is macpsych-request@stolaf.edu.
  1348.  
  1349.  
  1350.  
  1351.  
  1352. 6.2  Menus
  1353. ----------
  1354.  
  1355.  
  1356. -------------------------------------------------------------
  1357. 6.2.1  When do you put an ellipsis on the end of a menu item?
  1358. -------------------------------------------------------------
  1359.  
  1360. Put an ellipsis (...) at the end of any menu item which requires more
  1361. information in order to complete or simply displays information.  Usually
  1362. this involves a dialog of some kind, be it modal or non modal.
  1363.  
  1364.  
  1365.  
  1366. -----------------------------------------------------------
  1367. 6.2.2  How do I get the menubar to disappear and re-appear?
  1368. -----------------------------------------------------------
  1369.  
  1370. A set of routines to do this in Pascal can be found in the Usenet
  1371. Macintosh Programmer's Guide.  You can also ftp some sample code in C
  1372. from skinner.cs.uoregon.edu in /pub/mac/menu-bar.c.
  1373.  
  1374.  
  1375.  
  1376. -----------------------------------------------------------------------------
  1377. 6.2.3  What's the difference between the resource ID of a 'MENU' resource and
  1378.        the menuID field of that resource?
  1379. -----------------------------------------------------------------------------
  1380.  
  1381. The resource ID of a 'MENU' resource is just the resource ID - it has no
  1382. hidden meaning.  What is normally expected by beginning programmers is that
  1383. the number that MenuSelect and MenuKey return is the resource ID of the menu.
  1384. In fact, the number returned is the value of the menuID field of the menu,
  1385. and has no relation to the resource ID of the menu.  You can set the menuID
  1386. to any number you want, but by convention it is expected to be the same as
  1387. the resource ID of the menu.  (You can change this value in ResEdit by
  1388. opening the menu you wish to change, and selecting 'Edit Menu & MDEF ID...'
  1389. from the MENU menu.)
  1390.  
  1391.  
  1392.  
  1393.  
  1394. 6.3  Windows, Alerts, and Dialogs
  1395. ---------------------------------
  1396.  
  1397.  
  1398. ---------------------------------------------------------------------
  1399. 6.3.1  How do you put a border around the default button in a dialog?
  1400. ---------------------------------------------------------------------
  1401.  
  1402. The most common way to do this is to create a dummy user item in the dialog,
  1403. and use SetDItem to install a procedure that outlines the default button.
  1404. The dialog's "Initially visible" bit should be false and you should call
  1405. ShowWindow before calling ModalDialog; otherwise, if the button is very tall,
  1406. part of the outline won't be drawn.  Here is an example in C:
  1407.  
  1408.  
  1409. /* This function draws a border around dialog item #1 */
  1410.  
  1411. pascal void OutlineDefault(
  1412.     DialogPtr theDialog,
  1413.     short     theItem )
  1414. {
  1415.  
  1416.     Rect     itemRect;
  1417.     Handle   itemHandle;
  1418.     short    itemType;
  1419.     short    diameter;
  1420.  
  1421.     GetDItem( theDialog, 1, &itemType, &itemHandle, &itemRect );
  1422.     diameter = (itemRect.bottom - itemRect.top) / 2 + 6;
  1423.     if ( diameter < 16 )
  1424.         diameter = 16;
  1425.     PenSize( 3, 3 );
  1426.     InsetRect( &itemRect, -4, -4 );
  1427.     FrameRoundRect( &itemRect, diameter, diameter );
  1428.  
  1429. }
  1430.  
  1431.  
  1432.  
  1433. /* Assume myDialog has been initialized, and item #4 is the dummy
  1434.    user item for outlining the default button.  The following lines
  1435.    install the outlining procedure OutlineDefault into the user
  1436.    item, so that OutlineDefault will be called by the Dialog Manager
  1437.    each time the dialog needs to be redrawn.  Depending on your
  1438.    compiler, you may have to cast OutlineDefault to a Handle. */
  1439.  
  1440. GetDItem( myDialog, 4, &itemType, &itemHandle, &itemRect );
  1441. SetDItem( myDialog, 4, itemType, OutlineDefault, &itemRect );
  1442.  
  1443.  
  1444.  
  1445.  
  1446. 6.4  Drawing
  1447. ------------
  1448.  
  1449.  
  1450. ----------------------------------------------------------------
  1451. 6.4.1  What is the fastest way to paint one pixel on the screen?
  1452. ----------------------------------------------------------------
  1453.  
  1454. Using QuickDraw, the fastest way to draw one pixel is
  1455.    MoveTo( x, y );
  1456.    Line( 0, 0 );
  1457. making sure that the pen size is 1 by 1.  This is about twice as fast as
  1458. setting the pen size to 0 by 1 or 1 by 0 and calling Line( 1, 0 ) or
  1459. Line( 0, 1 ), respectively.  I'm not sure why....
  1460.  
  1461. See below for how to draw a pixel without using QuickDraw.
  1462.  
  1463.  
  1464.  
  1465. ----------------------------------------------------------------------
  1466. 6.4.2  How do you draw directly into a pixmap without using QuickDraw?
  1467. ----------------------------------------------------------------------
  1468.  
  1469. As an example, here is a routine that paints a single pixel in a pixmap.
  1470. To use this procedure, you just have to know what 'value' to pass in.  This
  1471. depends on the current bit-depth of 'thePixMap.'  The rightmost n bits of
  1472. 'value' are used for the pixel value for depth = n.  For depths of eight or
  1473. less, the value of each pixel is an index into a color table.  For depth =
  1474. 16,
  1475. each 16-bit pixel is interpreted as an RGB value, as follows:
  1476.  
  1477.          Bit: 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
  1478.        Value:  R  R  R  R  R  G  G  G  G  G  B  B  B  B  B  U
  1479.  
  1480. where R = Red, G = Green, B = Blue, and U = Unused.  For depth = 32, each
  1481. 32-bit pixel is interpreted as an RGB value as follows:
  1482.  
  1483.          Bit: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
  1484.        Value:  A  A  A  A  A  A  A  A  R  R  R  R  R  R  R  R
  1485.  
  1486.          Bit: 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
  1487.        Value:  G  G  G  G  G  G  G  G  B  B  B  B  B  B  B  B
  1488.  
  1489. where R = Red, G = Green, B = Blue, and A = Alpha.
  1490.  
  1491.  
  1492.  
  1493. void SetPixel(
  1494.     short           x,
  1495.     short           y,
  1496.     long            value,
  1497.     PixMapHandle    thePixMap )
  1498. {
  1499.  
  1500.     unsigned long   rowBytes;
  1501.     unsigned char   mask;
  1502.     unsigned char   shiftBits;
  1503.     unsigned char   *thePixel;
  1504.     unsigned char   pixelDepth;
  1505.     char            mode = true32b;
  1506.     Boolean         swapMode;
  1507.         swapMode = PixMap32Bit( thePixMap );
  1508.  
  1509.     LockPixels( thePixMap );
  1510.  
  1511.     rowBytes = (unsigned long) ((*thePixMap)->rowBytes & 0x1fff);
  1512.     thePixel = (unsigned char *) GetPixBaseAddr( thePixMap );
  1513.  
  1514.     pixelDepth = (*thePixMap)->pixelSize;
  1515.  
  1516.     switch ( pixelDepth ) {
  1517.             case 1:
  1518.         case 2:
  1519.         case 4:
  1520.         case 8:
  1521.  
  1522.             thePixel += (rowBytes * y) +
  1523.                         (((unsigned long) pixelDepth * x) / 8L);
  1524.  
  1525.             shiftBits = ((8 - pixelDepth) - ((x * pixelDepth) % 8));
  1526.  
  1527.             mask = (unsigned char) ((1 << pixelDepth) - 1) << shiftBits;
  1528.  
  1529.             if ( swapMode ) {
  1530.                 SwapMMUMode( &mode );
  1531.             }
  1532.  
  1533.             *thePixel &= ~mask;
  1534.             *thePixel |= (unsigned char) value << shiftBits;
  1535.  
  1536.             break;
  1537.  
  1538.  
  1539.         case 16:
  1540.  
  1541.             thePixel += (rowBytes * y) + (2L * x);
  1542.  
  1543.             if ( swapMode ) {
  1544.                 SwapMMUMode( &mode );
  1545.             }
  1546.  
  1547.             *((unsigned short *)thePixel) = (unsigned short) value;
  1548.  
  1549.             break;
  1550.  
  1551.  
  1552.         case 32:
  1553.  
  1554.             thePixel += (rowBytes * y) + (4L * x);
  1555.  
  1556.             if ( swapMode ) {
  1557.                 SwapMMUMode( &mode );
  1558.             }
  1559.  
  1560.             *((unsigned long *)thePixel) = value;
  1561.  
  1562.             break;
  1563.  
  1564.  
  1565.         default:
  1566.             break;
  1567.  
  1568.     }
  1569.  
  1570.     if ( swapMode ) {
  1571.         SwapMMUMode( &mode );
  1572.     }
  1573.  
  1574.     UnlockPixels( thePixMap );
  1575.  
  1576. }
  1577.  
  1578.  
  1579.  
  1580. ------------------------------------------------------------------------
  1581. 6.4.3  How do you draw directly onto the screen without using QuickDraw?
  1582. ------------------------------------------------------------------------
  1583.  
  1584. Get the pixmap for the monitor that you want to draw on, and send it to the
  1585. above procedure.  For example, to draw a red dot at position 10,10 on the
  1586. main screen (if the main screen is in 32-bit mode):
  1587.  
  1588.    GDHandle   theDevice;
  1589.  
  1590.    theDevice = GetMainDevice();
  1591.  
  1592.    SetPixel( x, y, 0x00FF0000, (*theDevice)->gdPMap );
  1593.  
  1594. If you are drawing directly to the screen, you should always wrap your
  1595. drawing with calls to ShieldCursor and ShowCursor.  Some monitors such
  1596. as the Radius Pivot series keep a virtual screen, and they don't update
  1597. the real screen unless they have to.  When you write directly to the
  1598. screen, you're actually writing to the virtual screen, and your drawing
  1599. won't show up on the real screen until the system has some other reason
  1600. to update the monitor.  Calling ShieldCursor each time you draw will
  1601. force these systems to update the real screen when you expect them to.
  1602.  
  1603.  
  1604.  
  1605. -----------------------------------------------------------------------
  1606. 6.4.4  What RGB value does the system use for dimmed buttons, menus and
  1607.        window titles?
  1608. -----------------------------------------------------------------------
  1609.  
  1610. The gray color does not have a fixed RGB value.  It is a weighted average of
  1611. the foreground and background colors.  To obtain the appropriate 'gray' color
  1612. for a given foreground and background color, use the Palette Manager routine
  1613. GetGray (documented in Inside Macintosh Volume VI).
  1614.  
  1615. pascal Boolean GetGray( GDHandle device, const RGBColor *backGround,
  1616.                         RGBColor *foreGround )
  1617.   = {0x303C,0x1219,0xAAA2};
  1618.  
  1619. If at least one gray or intermediate color is available, GetGray stores the
  1620. color in foreGround and returns true.  If no gray is available, or, if you
  1621. supplied two colors, no third distinguishable color is available, the
  1622. foreGround parameter is unchanged and the function returns false.
  1623.  
  1624. GetGray is not available in older versions of the system.  Use Gestalt to
  1625. determine whether it is available.
  1626.  
  1627.  
  1628.  
  1629.  
  1630. 6.5  Files
  1631. ----------
  1632.  
  1633.  
  1634. ----------------------------------------------
  1635. 6.5.1  Why is the File Manager so hard to use?
  1636. ----------------------------------------------
  1637.  
  1638. Its always those pesky wdrn's that are the problem.  Here is a summary of
  1639. some of the things to know:
  1640.  
  1641.     vrn = volume reference number
  1642.           (small negative number; e.g. -2)
  1643.     wdrn = working directory reference number
  1644.            (large negative number; e.g. -32123)
  1645.     dirID = directory ID
  1646.             (small (but long integer!) positive number; e.g. 4123)
  1647.  
  1648.     - vrn's and wdrn's can be used interchangably for the most part.
  1649.     - A vrn represents either a volume, or the root directory of a volume.
  1650.     - A wdrn represents a directory on a volume.
  1651.     - A dirID represents nothing without a vrn or a wdrn.
  1652.     - A dirID overrides the directory otherwise specified by the vrn or wdrn
  1653.       unless it's zero, in which case it's ignored.  If it is 2 it specifies
  1654.       the root directory of the volume.
  1655.     - You should always use vrn,dirID pairs. To convert a wdrn into a
  1656.       vrn,dirID pair use GetWDInfo, which returns the vRefNum, the dirID and
  1657.       the procID of the wdRefNum.  The procID is almost always 'ERIK'.
  1658.     - You can also use GetVol/SetVol to convert volume names to/from vrns.
  1659.     - To store a vrn,dirID pair (between invocations of a program) convert
  1660.       the vrn to a volume name & creation date (for verification) and store
  1661.       them and the dirID (and a filename perhaps).
  1662.  
  1663.  
  1664.  
  1665. --------------------------------------
  1666. 6.5.2  How do you get a full pathname?
  1667. --------------------------------------
  1668.  
  1669. Take a look at Tech Note #238, available from APDA (and other places).  It
  1670. tells you everything you need to know to get a full pathname, and why you
  1671. should, in general, use a volume name, dirID, filename (and perhaps volume
  1672. creation date) triple instead.  Also check out the code snippets available
  1673. from ftp.apple.com et al.  There are a couple of snippets that give code to
  1674. get a full pathname, as well as many other cool file manager tricks.
  1675.  
  1676.  
  1677.  
  1678. --------------------------------------------------
  1679. 6.5.3  How do you set the SFGet/PutFile directory?
  1680. --------------------------------------------------
  1681.  
  1682. To set the directory that is displayed by SFGet/PutFile, stuff the volume
  1683. reference number into SFSaveDisk, and the dirID into CurDirStore.
  1684.  
  1685.      CurDirStore = $398;   Current dirID from Standard File (long)
  1686.      SFSaveDisk = $214;    Negative of current vRefNum
  1687.  
  1688.  
  1689.  
  1690. -----------------------------------------------------
  1691. 6.5.3  How do you access the application's data fork?
  1692. -----------------------------------------------------
  1693.  
  1694. Call CurResFile when the application starts up.
  1695. Call PBGetFCBInfo to convert that refNum into a vRefNum, dirID and name.
  1696. Call HOpen with the vRefNum, dirID, and name to open up your data fork.
  1697.  
  1698.  
  1699.  
  1700.  
  1701. 6.6  Handles and Pointers
  1702. -------------------------
  1703.  
  1704.  
  1705. ----------------------------------
  1706. 6.6.1  When should I call MoveHHi?
  1707. ----------------------------------
  1708.  
  1709. MoveHHi is an expensive operation; calling it when you don't need to can
  1710. significantly slow down your program.  Additionally, over-calling of MoveHHi
  1711. can fragment the top of your heap.  Call MoveHHi before locking a handle that
  1712. is followed by some memory allocation.  To efficiently move a handle high in
  1713. the heap and then lock it, you might want to call HLockHi, a call new with
  1714. MPW 3.2 and THINK C 5.0 (probably THINK Pascal 4.0 as well).
  1715.  
  1716.  
  1717.  
  1718. -------------------------------------------------------------------------
  1719. 6.6.2  Why does malloc/calloc keep crashing or returning NULL in Think C?
  1720. -------------------------------------------------------------------------
  1721.  
  1722. #include <stdlib.h>
  1723.  
  1724. Explanation:  In THINK C, parameters and return values are 2-byte ints by
  1725. default, which causes the value passed to malloc to be $10000 times as large
  1726. as you think it is, and causes the upper bytes of the return value to be
  1727. zeroed.  Including stdlib includes a prototype which overrides the defaults.
  1728.  
  1729. Another common cause of problems with malloc is overwriting the end of a
  1730. string, such as only mallocing the size of the string and then writing the
  1731. string plus a null into the malloc'd space.  Think's malloc algorithm stores
  1732. block size information in space adjacent to the storage it allocates, so
  1733. overwriting the storage tends to cause havoc. The problem may not show
  1734. immediately since it will probably be the next malloc that encounters
  1735. problems.
  1736.  
  1737.  
  1738.  
  1739.  
  1740. 6.7  Standalone Code
  1741. --------------------
  1742.  
  1743.  
  1744. ------------------------------
  1745. 6.7.1  How do I write an INIT?
  1746. ------------------------------
  1747.  
  1748. There is a simple INIT (SetWindow INIT) with source code and explanations in
  1749. the Usenet Macintosh Programmer's Guide.  There is also a chapter on writing
  1750. system extensions in Macintosh Programming Secrets (2nd Ed.).  Be sure to
  1751. check out the ftp sites (especially ftp.apple.com) for sample inits.
  1752.  
  1753.  
  1754.  
  1755.  
  1756. 6.8  General
  1757. ------------
  1758.  
  1759.  
  1760. --------------------------------------------------------------
  1761. 6.8.1  How do I register signatures and file types with Apple?
  1762. --------------------------------------------------------------
  1763.  
  1764. Registering a signature and file type is free, and you don't have to be an
  1765. Apple Partner or Associate.  You can ftp the registration form from
  1766. ftp.apple.com; it's available as
  1767.      /dts/mac/registration/creator-file-type-form.txt.
  1768.  
  1769.  
  1770.  
  1771. -------------------------------------------------------------------------
  1772. 6.8.2  How do I go about writing serial port communications?
  1773.  
  1774. These days, it is best to use the new Comunications Toolbox (CTB).  By
  1775. utiizing the CTB, you will be able to write your code to a single
  1776. specification, and the code will work with all current CTB "tools" and all
  1777. future CTB tools. The CTB tools allow programmers to extend the CTB's
  1778. functionality. There is a tool for each facet of the communications puzzle:
  1779. Connection Tools, Terminal Tools, and File Transfer Tools.
  1780.  
  1781. For example, once I have written a piece of code that uses the Serial tool to
  1782. connect me to a terminal server, combined with the VT102 Tool to emulate a
  1783. vt102 terminal, and the XMODEM Macbinary Tool to transfer files, the same
  1784. code will work with Apple Modem Tool, TCP/IP, AppleTalk ADSP, ISDN, X.25, and
  1785. all future Connection Tools. Further, the terminal can emulate a VT320,
  1786. ASCII, or other terminals. Files may be transfered with XMODEM, TEXT, and
  1787. soon ZMODEM and Kermit protocols.
  1788.  
  1789. The disadvantage of the CTB is that you must limit yourself to the
  1790. specification of the Connection, Terminal, and File Transfer interfaces.
  1791. These limitations are *rarely* a problem, but clearly something like a FAX
  1792. interface program or real time data analyzer, would have to seriously
  1793. consider the interfaces before committing.
  1794.  
  1795. For most standard communications applications, such as terminal emulators,
  1796. Bulletin Board Systems, etc., the CTB is the correct choice.
  1797.  
  1798. You can only get the CTB development kit from APDA.  It is affordable,
  1799. somewhere just under $100.  This includes working sample code.
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.                       ================================
  1806.                         Section VII: Eternal Debates
  1807.                       ================================
  1808.  
  1809.  
  1810. These questions have no final answers.  They pop up every few months and
  1811. waste a tremendous amount of valuable network resources on discussions
  1812. that will never be resolved.  Most people would be happy if they were
  1813. never discussed again in this newsgroup.
  1814.  
  1815.  
  1816. 7.1  Why doesn't the Mac do preemptive multitasking?
  1817. ----------------------------------------------------
  1818.  
  1819. Pro-preemptives claim the current scheme is too vulnerable to ill-behaved
  1820. applications and too much trouble for application writers.  Anti-
  1821. preemptives claim that preemptive multitasking would reduce interactive
  1822. response, and that the current cooperative system works well.
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.                        ==============================
  1829.                          Credits / Acknowledgements
  1830.                        ==============================
  1831.  
  1832.  
  1833. Many thanks to Ben Haller, who started this whole thing, and did quite a lot
  1834. of work on this posting before handing it off to Michael A. Kelly.  Many
  1835. thanks to Michael A. Kelly also, for all his work in establishing and
  1836. maintaining this FAQ (in addition to continuing to keep the
  1837. Comp.Sys.Mac.Programmer Digest) before passing the baton.
  1838.  
  1839. Thanks to these people for proofreading this list during its development:
  1840.     Ben Haller
  1841.     Wally Wedel
  1842.     John B. Matthews
  1843.     Patrick Beard
  1844.     Steve Zellers
  1845.  
  1846. Thanks to Chris Webster for the one-liners.
  1847.  
  1848. Thanks to Peter Lewis for the answers to the following specific questions:
  1849.     6.2.1  When do you put an ellipsis on the end of a menu item?
  1850.     6.5.1  Why is the File Manager so hard to use?
  1851.     6.5.2  How do you get a full pathname?
  1852.     6.5.3  How do you set the SFGet/PutFile directory?
  1853.  
  1854. Thanks to Greg Ferrar for the review on TMON Pro.
  1855.  
  1856. Thanks to John Rinaldo for the review on Jasik's Debugger.
  1857.  
  1858. Thanks for Fritz Anderson for his descriptions of SourceBug and the new
  1859. Inside Macintosh volumes.
  1860.  
  1861. And thanks to everyone who has offered suggestions or constructive
  1862. criticism....  Keep those comments coming!
  1863.  
  1864.  
  1865.  
  1866.  
  1867. --
  1868. -------------------------------------------------------------------
  1869.  Daryl_Spitzer@mindlink.bc.ca     "Life isn't just, life just is."
  1870.          a2251@mindlink.bc.ca              -- Me  (I think.)
  1871. -------------------------------------------------------------------
  1872.