Develop-28 9612 December 1996.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
EDITORIAL STAFF THINGS TO KNOW Editor-in-Cheek Caroline Rose develop, The Apple Technical Journal, a quarterly publication of the Managing Editor Stacy Fields, Toni Moccia Apple Developer Relations group, is published in March, June, September, and December. It provides developers of Apple-platform products with technical Technical Buckstopper Dave Johnson articles and code that have been reviewed for robustness by Apple engineers. Our Boss Steve Strong His Boss Garry Hornbuckle All issues of develop, along with the code they describe, can be found on the develop Bookmark CD Leader Alex Dosher Bookmark CD, the Reference Library edition of the Developer CD Series, and the Review Board Brian Bechtel, Dave Radcliffe, Internet. The code is updated regularly, so always use the latest version. Quinn “The Eskimo!”, Jim Reekes, This issue’s CD. Subscription issues of develop are accompanied by the develop Bryan K. “Beaker” Ressler, Larry Rosenstein, Bookmark CD. This CD contains a subset of the materials on the Developer CD Series, Nick Thompson, Gregg Williams which is part of the Apple Developer Mailing available through the Apple Developer Contributing Editors Lorraine Anderson, Catalog. The CD also contains Technotes, sample code, and other documentation Toni Haskell, Cheryl Potter, Erik Sea, and tools (these contents are subject to change). Items referred to as being on “this George Truett issue’s CD” are located either on the Bookmark CD or on the Reference Library or Indexer Marc Savage Tool Chest edition of the Developer CD Series. ART & PRODUCTION Subscriptions and back issues. You can subscribe to develop through the Apple Developer Catalog (see below, or use the subscription card in this issue). Back Art Direction Lisa Ferdinandsen issues, in addition to being available electronically, can also be ordered through the Technical Illustration John Ryan catalog. The one-year U.S. subscription price is $30 (for four issues and four develop Formatting Forbes Mill Press Bookmark CDs), or U.S. $50 in other countries. Back issues are $13 each. These prices Production Diane Wilcox include shipping and handling. For Canadian orders, the subscription price includes Photography Sharon Beals, Leilani Coe, GST (R100236199). Adrienne Gersnoviez WHERE TO FIND US Cover Illustration Cary Henrie What Who/where ISSN #1047-0735. © 1996 Apple Computer, develop on the Web http://www.devworld.apple.com/develop/ Inc. All rights reserved. Apple, the Apple logo, and ftp ftp://ftpdev.info.apple.com/Developer_Services/ AppleScript, AppleTalk, ColorSync, LaserWriter, Periodicals/develop/ Mac, MacApp, Macintosh, Macintosh Quadra, MacTCP, MessagePad, MPW, MultiFinder, Bookmark CD contents http://www.devworld.apple.com/ Newton, OpenDoc, Power Mac, Power Macintosh, ftp://ftpdev.info.apple.com/Developer_Services/ PowerTalk, QuickTime, StyleWriter, and TrueType are trademarks of Apple Computer, Technotes on the Web http://www.devworld.apple.com/dev/technotes.shtml Inc., registered in the U.S. and other countries. AOCE, A/ROSE, Balloon Help, develop, Dylan, Editorial comments Caroline Rose, [email protected], (408)974-0544 fax Finder, NewtonScript, ToolServer, and or suggestions QuickDraw are trademarks of Apple Computer, Technical questions Dave Johnson, [email protected], (408)974-0544 fax Inc. Adobe and PostScript are trademarks of Adobe Systems Incorporated or its subsidiaries about develop and may be registered in certain jurisdictions. Article submissions [email protected] (ask for our Author’s Kit) QuickView is licensed from Altura Software, Inc. PowerPC, SOM, and SOMobjects are trademarks Apple Developer Catalog http://www.devcatalog.apple.com of International Business Machines Corporation, (develop subscription, back [email protected] used under license therefrom. UNIX is a issues, or other products) 1-800-282-2732 U.S., 1-800-637-0029 Canada registered trademark in the United States and (716)871-6555 internationally, (716)871-6511 fax other countries, licensed exclusively through X/Open Company, Ltd. All other trademarks Apple Developer Catalog, Apple Computer, Inc., P.O. Box are the property of their respective owners. 319, Buffalo, NY 14207-0319 Subscription changes or [email protected] Printed on recycled paper by queries Please be sure to include your name, address, and account Stream International, USA number as they appear on your mailing label. Issue 28 December 1996 A R T I C L E S 4 Coding Your Object Model for Advanced Scriptability by Ron Reuter Basic support for an Apple event object model isn’t too tough, but supporting more complex scripts takes some planning, and can trip you up in subtle ways if you’re not careful. This advice will help you out. 32 New QuickDraw 3D Geometries by Philip J. Schneider QuickDraw 3D 1.5 includes several useful new geometric primitives. This article introduces the new primitives and discusses the differences among the various polyhedral primitives, both new and old. 60 QuickDraw GX Line Layout: Bending the Rules by Daniel I. Lipton The typographic capabilities of QuickDraw GX are without peer, but until now drawing that beautiful text along an arbitrary path took a concerted effort. Here’s a library that makes it easy to do. 76 MacApp Debugging Aids by Conrad Kopala Programming with a framework saves time and effort, but debugging can be difficult, since there’s a lot going on beneath the surface. These techniques for detecting problems in MacApp programs can help. 91 Chiropractic for Your Misaligned Data by Kevin Looney and Craig Anderson Misaligned data accesses on PowerPC processors can be very expensive. Two tools that will help you detect misalignment problems are presented here, along with some advice on avoiding misalignment in the first place. C O L U M N S 28 THE OPENDOC ROAD 101 MACINTOSH Q & A OpenDoc Memory Management and the Apple’s Developer Support Center answers Toolbox queries about Macintosh product development. by Troy Gaul and Vincent Lo Managing memory allocation in your OpenDoc 110 THE VETERAN NEOPHYTE part editor can be a little tricky. Confessions of a Veteran Technical Writer by Tim Monroe 56 PRINT HINTS Enlightening trade secrets from someone who Safe Travel Through the Printing Jungle writes the documentation we all depend on. by Dave Polaschek Printing is often much more complex than it 113 NEWTON Q & A: ASK THE LLAMA needs to be. By keeping it simple and staying on Answers to Newton-related development the well-trod path, you can protect yourself. questions. Send in your own questions for a chance at a T-shirt. 72 BE OUR GUEST Source Code Control for the Rest of Us 118 KON & BAL’S PUZZLE PAGE by D. John Anderson and Alan B. Harper Folder Fun Source control doesn’t need to be complex, as by Konstantin Othmer and Bruce Leak the simple tools presented here will show. Is a puzzle without a solution really a puzzle? Only you can decide. Those divas of debugging 88 MPW TIPS AND TRICKS run us through the wringer once again. Automated Editing With StreamEdit by Tim Maroney The MPW tool StreamEdit provides you with 2 EDITOR’S NOTE powerful, flexible, scriptable text editing, at the 3 LETTERS price of just a little complexity. 123 INDEX CONTENTS 1 EDITOR’S NOTE Regular readers of develop may know that, while I always use the latest hardware and software at work, my home system is woefully out of date — at least it was until I recently upgraded to a Power Mac. The initial setup wasn’t too hard, once I got used to flipping back and forth between the manual for the computer, the manual for the monitor, and the online updates; when all else failed, I relied on common sense. But when I moved beyond hardware setup into software installation, it seemed as if I was expected to know much more than I did. The modem software installer, for example, would just name a software module and say “click OK if you want to install this,” with no mention of which module(s) provided the basic modem capabilities (which is all I wanted). What to do? I recently had this same feeling while trying to learn a new e-mail application at work: though I immediately saw how to address mail to anyone on any network in the known world with barely a keystroke, I couldn’t tell how to simply enter an address for someone here at Apple. In these and many similar cases CAROLINE ROSE I’ve encountered recently, I couldn’t figure out how to perform basic application functions without the intervention of an experienced user. The manuals and online help were somewhat helpful, but they were limited by the design of the software, which was the problem in the first place. Common sense was no help at all. Naturally I griped about this to my “friends in the industry.” I think one of them hit the nail on the head when he said the problem is that too many products are being designed by experts who, consciously or not, design for experts. Designing with experts in mind ends up complicating everything, even the features that should be simple. Bud Tribble, when he managed the software group at NeXT, used to tell programmers, “Simple things should be simple, and complex things should be possible.” It seems increasingly true these days that designers are trying to make complex things simple, but as a result are making simple things complex. Design by experts for experts is not the answer: developers need to find out what real users want, and focus on their needs. Is develop guilty of a similar problem? When I looked at the feedback we gathered at Apple’s Worldwide Developers Conference this year, I noticed that some develop readers are asking for more entry-level articles, saying that a lot of what we publish is over their heads.