Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!Apple.COM!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: Toolbox Gotchas (LONG) Message-ID: <1755@internal.Apple.COM> Date: 10 May 89 16:54:30 GMT References: <10050096@accuvax.nwu.edu> Sender: usenet@Apple.COM Organization: Objects-R-Us, Apple Computer, Inc. Lines: 33 Here are some others off the top of my head: * Be sure to set ioVersNum to 0 in the approrpiate paramter blocks, even if you call PBHOpen, etc. The description of PBHOpen doesn't mention this as a parameter, but a call to PBHOpen will be treated as a call to PBOpen on an MFS disk, and then the field must be 0. * Be aware of the Poor Man's Search Path. For example, when saving a file, don't call PBOpen or PBDelete to get rid of the existing file first. If the filename is the same as one in the system folder, you will get that file instead. You can disable the effect of the PMSP by setting an explicit dirID in the call. Also, note that Create doesn't use the PMSP, OpenResFile doesn't give you the option to set the dirID, and CreateResFile calls OpenResFile first. If you are creating a resource file, it is best to call Create first, to create the file, and then CreateResFile (see Tech Note 101; or use the MPW glue routine described in Tech Note 214.) * When creating a picture, always set the clip region to the minimum bounding box. When a picture is replayed and offset from its original position. All the coordinates in the picture are offset. If the clip region is the largest possible rectangle, it will be offset as well, and the coordinates will overflow resulting in an empty clipping. Larry Rosenstein, Apple Computer, Inc. Object Specialist Internet: lsr@Apple.com UUCP: {nsc, sun}!apple!lsr AppleLink: Rosenstein1