Path: utzoo!attcan!uunet!husc6!ukma!uflorida!mailrus!cornell!biar!trebor From: trebor@biar.UUCP (Robert J Woodhead) Newsgroups: comp.sys.mac Subject: Re: WingZ Keywords: spreadsheet, presentation manager, hypertext, slow Message-ID: <503@biar.UUCP> Date: 27 Apr 89 15:05:11 GMT References: <598@eutrc3.UUCP> <1774@ccnysci.UUCP> Reply-To: trebor@biar.UUCP (Robert J Woodhead) Organization: Biar Games, Inc. Lines: 42 In article <1774@ccnysci.UUCP> alexis@ccnysci.UUCP (Alexis Rosen) writes: >Actually, it can break a variety of things, most of them obscure, but is >more likely to fail in the future. Robert Woodhead wrote an article about >tricks for programming the Mac, about two-three tears back, which wound up >on the Arpa Info-Mac group (and maybe here too), wherein he recommended >doing this. There were many responses about how this wouldn't work in certain >circumstances. Speaking as the original villian (heh heh heh! Now, sign over your property to me! nyah hah hah!) in this story, I'd like to set things straight. First of all, don't save/restore bitmaps over dialog box calls. It will break for all sorts of reasons, including the screen depth changing on you. Only Apple can get away with these shenannigans reliably (as per the Insert Disk box) because they can upgrade stuff as the environment changed (and you can't). Back in the bad old days before Mac II and Multifinder, you could get away with this gem FOR YOUR OWN DIALOGS. I did this performance hack in Mac Wizardry because in that game there were often a lot of windows that would get obscured by a dialog, and it was a pain to repaint them all, especially on 128k Macs (yecch! ptui!). If you want to get the same effect in your application, you have to shadow each window with an offscreen bitmap that contains a copy of what is in the window; eg: always paint to the offscreen bitmap, then copybits onto the screen (this has the nice bonus that Quickdraw handles depth conversion). Advantages are: very quick repaints when windows are activated, or when a dialog box goes away. Disadvantages: uses lots of memory, and regular operations will be slightly slower due to the extra copybits call. Real use: use only on windows that take more than 10 seconds to recompute, to prevent the onerous wait the original poster got. -- Robert J Woodhead, Biar Games, Inc. ...!uunet!biar!trebor | trebor@biar.UUCP "The NY Times is read by the people who run the country. The Washington Post is read by the people who think they run the country. The National Enquirer is read by the people who think Elvis is alive and running the country..."