Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!claris!UUCP!peirce From: peirce@outpost.UUCP (Michael Peirce) Newsgroups: comp.sys.mac.programmer Subject: Re: Correct way in Dialog to set Icons on the fly Message-ID: Date: 29 Jun 91 05:14:22 GMT Reply-To: peirce@outpost.UUCP (Michael Peirce) Organization: Peirce Software Lines: 32 X-Mailer: uAccess - Mac Release: 1.5 In article <6706@ns-mx.uiowa.edu>, wolf@piquet.cipl.uiowa.edu (Michael J. Wolf) writes: > What is the proper way to set and change ICON dilaog items? > > I would like to use the same dialog template but set the ICONs as > I go (ie, just before or while the dialog is visible). > > Should I get the ItemHandle, and go to the correct offset (something > like 10 bytes from where the handle points) and manual modify this > integer to the ID of the ICON I want to be displayed now. Afterward > do a draw dialog? I'm not sure about icons (i tried it), but I know you can set the item handle for a PICT item to a Picture Handle and have the the new picture drawn. You might try this with a handle to an icon too. Here's how it's done with PICTs: GetDitem(theDialog,kPict2Item,itemType,pictH,itemRect); pictH := aPictHandle; SetDItem(theDialog,kPict2Item,itemType,pictH,itemRect); Or if it doesn't work with icons, use PICTs instead... -- michael -- Michael Peirce -- outpost!peirce@claris.com -- Peirce Software -- Suite 301, 719 Hibiscus Place -- Macintosh Programming -- San Jose, California 95117 -- & Consulting -- (408) 244-6554, AppleLink: PEIRCE