Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!know!news.cs.indiana.edu!att!bellcore!twinkie!bobh From: bobh@twinkie.bellcore.com (Robert Hettmansperger) Newsgroups: comp.sys.mac.programmer Subject: Re: Updating ICONs in a dialog box Keywords: ICONs Dialog Box Update Message-ID: <1991Apr4.140811.15901@bellcore.bellcore.com> Date: 4 Apr 91 14:08:11 GMT References: <1991Apr3.142215.2787@bellcore.bellcore.com> Sender: usenet@bellcore.bellcore.com (Poster of News) Reply-To: bobh@twinkie.bellcore.com (Robert Hettmansperger) Followup-To: bobh@twinkie.bellcore.com Organization: Bell Communications Research, Red Bank, New Jersey Lines: 25 In article <1991Apr3.142215.2787@bellcore.bellcore.com> I wrote: > >The problem is that the text updates as I expected, but in order to get the >new icon to appear, I have to call DrawDialog to redraw the entire dialog >box. This is slow and makes the entire dialog flicker. I have tried almost >everything to get just the icon redrawn and can't come up with anything else >that works. > Thanks to all who responded. The easiest solution turned out to be just to set the current GrafPort to the dialog box and call PlotIcon to draw the icon directly. Interestingly, the most common recommendation was to flag the icon's rectangle for updating with InvalRect. I couldn't get this to work at all. I'm not sure if it was just due to differences in the dialog vs. the window manager, or if I just wasn't doing it right. Thanks again, Bob Hettmansperger bobh@twinkie.bellcore.com P.S. Another suggestion was to make the icon a user item, but I couldn't manage to set up the procedure pointer to be called as the "item" in SetDItem. Anyone have suggestions on writing userItems with Think's C?