Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!husc6!sunfs3!kent From: kent@sunfs3.camex.uucp (Kent Borg) Newsgroups: comp.sys.mac.programmer Subject: Being switched while recording a picture Summary: What precautions to take? Keywords: picture switch GetNextEvent picSave grafPort GWorld 32-Bit QuickDraw MultiFinder Message-ID: <580@sunfs3.camex.uucp> Date: 19 Dec 89 00:10:36 GMT Reply-To: kent@lloyd.UUCP (Kent Borg) Organization: Camex, Inc., Boston, Mass USA Lines: 31 What are the implications of being switched out while recording a picture? I have been working on TIFF -> PICT code for what seems like forever. Trying to be nice while converting the data, I decided that I should allow myself to be switched out once each time through my main data conversion loop. I didn't occur to me an innocent looking GetNextEvent could have been causing me all this grief I have been suffering, but it looks like it has. Being switched out while in the midst of recording a picture seems less than a good idea--now that I have noticed it. How can I do this safely? My current idea is to save my grafPort's picSave handle, substitute nil, call GetNextEvent (I know, use WaitNextEvent--but in this case I think it reduces down to the same call), then replace the picSave I cleverly preserved. (see IM I-189) No go. Still dies. There seems to be more to it than I am currently handling. One important detail: the grafPort I am using to record this picture is actually one of those new-fangled offscreen GWorlds that 32-Bit QuickDraw gives us. Anybody played with them yet? -- Kent Borg lloyd!kent@husc6.harvard.edu or ...!husc6!lloyd!kent MacNet: kentborg H:(617) 776-6899 W:(617)426-3577 "The wall has been opened. One of the most insurmountable borders in Europe has become a German dance floor." -Christoph Hein, NYT Magazine, 17 Dec 1989