Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!spool.mu.edu!snorkelwacker.mit.edu!paperboy!hsdndev!dartvax!chocorua!kurash From: kurash@chocorua.dartmouth.edu (Mark Valence) Newsgroups: comp.sys.mac.programmer Subject: Re: moving dialog items... Summary: Don't use MoveControl Keywords: foo bar Message-ID: <1991Mar20.155851.26446@dartvax.dartmouth.edu> Date: 20 Mar 91 15:58:51 GMT References: <12425@pt.cs.cmu.edu> Sender: news@dartvax.dartmouth.edu (The News Manager) Reply-To: kurash@chocorua (Mark Valence) Organization: Dartmouth College Lines: 34 In article <12425@pt.cs.cmu.edu> hairston@henry.ECE.CMU.EDU (David Hairston) writes: >[gb2a+@andrew.cmu.edu (George J. Baxter) writes:] >[] A question.. I've got a modeless dialog box with PICT resource items >[] on it acting like buttons. I have one that I want to 'animate' in a >[] crude way by having it move from one position to another and back again. >[] I thought I'd be tricky and get the item's Rect, HideDItem, then change >[] the Rect, then ShowDItem. >[] Guess what, it didn't work. It wouldn't redraw the PICT, though the >[] Rect did in fact move. However, upon a refresh with DialogSelect(), >[] kaboomy. > >try MoveControl(theControl: ControlHandle; h,v: Integer); > >for further details: IM-I, Chap. 10, The Control Manager & Chap. 13, >The Dialog Manager (basically there's a warning about using the dialog >manager to do control manager stuff). No, don't use MoveControl to move your PICT item. MoveControl assumes that the data in the handle that it is passed is a ControlRecord. When you pass the PicHandle to MoveControl, boom-o. Your second intuition seemed the proper one: use a user item. Drawing pictures is not that difficult, and DialogSelect will not go kaboomy. Of course, it's not trivial: you need a filterproc, and a user item drawing proc, and a global variable that tells you where within the user item your picture is located (alternately, you can use the refCon of the dialog window to store a pointer to info about the user item, like which PICT resource to use, where to place it, etc). If you want details, e-mail (although I've been having trouble with bounces lately). > > -dave- >hairston@henry.ece.cmu.edu Mark.