Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!bellcore!twinkie.bellcore.com!bobh From: bobh@twinkie.bellcore.com (Robert Hettmansperger) Newsgroups: comp.sys.mac.programmer Subject: Updating ICONs in a dialog box Keywords: ICONs Dialog Box Update Message-ID: <1991Apr3.142215.2787@bellcore.bellcore.com> Date: 3 Apr 91 14:22:15 GMT Sender: usenet@bellcore.bellcore.com (Poster of News) Reply-To: bobh@twinkie.bellcore.com (Robert Hettmansperger) Organization: Bell Communications Research, Red Bank, New Jersey Lines: 26 Hello, I'm in the process of developing my first "real" Mac program and have run up against a problem with the Dialog Manager. What I want to do is bring up a dialog box which has a "ROTATE" button. Basically, there is a static text item and an icon item in the dialog, which start with default values. Whenever the ROTATE button is pressed the text and associated icon should progress to the next of four possibilities (or return to the first possibility). To do this, I have set up four consecutive STR and ICON resources with the desired text and icons. When the dialog box is brought up initially, the first text/icon pair are displayed. I then call ModalDialog and if the ROTATE button was pressed, I use SetIText to change the text item (I get the new text with GetString) and SetDItem to change the icon (I get the new icon using GetIcon). 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. Does anyone have any suggestions on how to update *only* the text and icon? Thanks, Bob Hettmansperger bobh@twinkie.bellcore.com