Xref: utzoo comp.sys.mac:39192 comp.sys.mac.programmer:9354 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!stat!vsserv!loligo.cc.fsu.edu!pepke From: pepke@loligo.cc.fsu.edu (Eric Pepke) Newsgroups: comp.sys.mac,comp.sys.mac.programmer Subject: Macintosh One-Liners Message-ID: <221@vsserv.scri.fsu.edu> Date: 28 Sep 89 22:28:51 GMT Sender: news@vsserv.scri.fsu.edu Reply-To: pepke@loligo.cc.fsu.edu (Eric Pepke) Distribution: na Organization: Supercomputer Computations Research Institute Lines: 87 As you all know, there are a few questions that are asked over and over again. Every once in a while, somebody asks "Why is my menu bar flashing?" or "Why is the right side of my offscreen bitmap cut off?" The cognoscente among us think "Oh, no, not again," and then post 200 notes flaming the poor person or Apple or somebody for the fact that this stuff is not intuitively obvious. These discussions are fun, and the Apple documentation and tech notes are fine, but neither particularly helps the person who would have to do a linear search through it all to answer a question. Long explanations giving options and details and full explanation are great, but the problem is that people don't read them. In order to help solve this problem, I am compiling a list of one-liners about using and programming the Macintosh. A one-liner is defined as a single line of text (fewer than 80 characters, that is) which gives some vital piece of information for a novice user or programmer. They are kept short so that they can all be written on a single sheet of paper and consulted by reading the entire sheet without spending too much time. One-liners can state facts about the Macintosh or give advice. The facts need not tell the complete story, but they should suggest a place to start. The advice need not give the only way of doing a thing and should not be interpreted by experts as offensive if they think they have a better way, but they should give advice which, if followed, will reduce the possible problems later on. They should resemble proverbs more than explanations. One-liners should ideally implicitly contain keywords that the user can look up in the indices of the Macintosh documentation. The one-liner about Easy Access, for example, does not contain dozens of interesting pages about what Easy Access is and how to use it, but a person who knows the name should be able to look it up. This is what I have so far: Users' One-Liners: A flashing Apple menu means the alarm clock is ringing. A beep on opening a desk accessory means DA Handler is not in the System folder. A U-shaped icon at the right of the menu bar means Easy Access is activated. If HyperCard visual effects donUt work, try setting the monitor to 2 colors. Hold down command-F and click OK in the print dialog to make a PostScript file. Hold down command-K instead to make a PostScript file which includes LaserPrep. Turn background printing off before trying to make a PostScript file. Remove the paper tray during LaserWriter power up to avoid the startup page. Programmers' One-Liners: Do not use SetEventMask to disable mouseUp events. Always set the VisRgn and ClipRgn of offscreen ports. Set the ClipRgn first when making a picture. Move and size windows to the bounding box of GetGrayRgn. Check the application name at $910 before exiting with ES within MacsBug. To exit to shell in the mini-debugger, enter SM 0 A9 F4 and then G 0. itemHit will not be set when a dialog filter is called. Use SysEnvirons to find the Blessed Folder. Use GetAppParms to get the name of the application. The high bit of SysParam . volClik enables the alarm clock. Don't make rowBytes in bitMaps greater than 8191. Don't write in the application file. This will fail with read-only devices. Save application preferences in a file in the Blessed Folder. Hide scroll bars when deactivating a window. Call DrawGrowIcon when activating or deactivating a window with a grow region. DrawGrowIcon does not check to see if the window has a grow region. Ensure that the current grafPort is valid at ALL times. DA's might change it. Truncate and reallocate files before overwriting to reduce fragmentation. Check the creator and type of Save As... files before overwriting. Use a disabled UserItem to draw the roundrect outline around the OK button. If you rewrite files by deleting and creating, copy all Finder information. Delete uses the Poor Man's Search Path, so don't delete blindly. Call GetDblTime to get the maximum time for a double click. Call IsDialogEvents and DialogSelect even if GetNextEvent returns false. Use HT in MacsBug to estimate how many times to call MoreMasters. Use SetItem to include meta characters literally in menus. Most of these are from my own experience. Some are straight from what I have seen in the newsgroups over the past year or so. I have checked out most, but not all. If you have suggestions for additions or corrections, please post them in this newsgroup. Eric Pepke INTERNET: pepke@gw.scri.fsu.edu Supercomputer Computations Research Institute MFENET: pepke@fsu Florida State University SPAN: scri::pepke Tallahassee, FL 32306-4052 BITNET: pepke@fsu Disclaimer: My employers seldom even LISTEN to my opinions. Meta-disclaimer: Any society that needs disclaimers has too many lawyers.