Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Updating dialogs Message-ID: <6179@hoptoad.uucp> Date: 6 Jan 89 09:58:58 GMT References: <373@lclark.UUCP> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 21 In article <373@lclark.UUCP> dan@lclark.UUCP (Dan Revel) writes: >What's the best way to update a non-modal dialog after changing one of >its dialog items? Here's my problem: I want to display differing icons >in response to user radio button selections, right now I call DrawDialog(...) >to redraw the whole window but that causes everything to flicker and I would >rather just redraw the icon I have changed. I tried just using InvalRect on >the rect returned by GetDItem but to no update event is generated... You also need to make sure that the current GrafPort at the time of the InvalRect is the dialog GrafPort. If you do this, an update event will be returned on the dialog by GetNextEvent, and when you call DialogSelect the item will be redrawn. My guess is you just forget to set the GrafPort before doing the InvalRect. It would also be a good idea to do an EraseRect before or after doing the InvalRect, or you may find your new icon superimposed over the old one (or maybe not, but it shouldn't hurt to be safe). -- Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim "There's a real world out there, with real people. Go out and play there for a while and give the Usenet sandbox a rest. It will lower your stress levels and make the world a happier place for us all." -- Gene Spafford