Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!mimsy!tank!ra_robert@gsbacd.uchicago.edu From: ra_robert@gsbacd.uchicago.edu Newsgroups: comp.sys.mac.programmer Subject: Re: Getting usrItem to draw itself during ModalDialog Message-ID: <2643@tank.uchicago.edu> Date: 7 Apr 89 03:11:42 GMT Sender: news@tank.uchicago.edu Distribution: na Organization: University of Chicago Graduate School of Business Lines: 31 In article <6899@hoptoad.uucp>, tim@hoptoad.uucp (Tim Maroney) writes... >In article <11235@well.UUCP> brecher@well.UUCP (Steve Brecher) writes: >>InvalRect operates on the current grafPort. There is no assurance that >>your dialogUs port is current when your filter is called. Use SetPort >>before calling InvalRect. > >True as far as it goes, but there shouldn't even be a need to call >InvalRect. I've used userItems for years and there's never been any >reason to call InvalRect on the item rectangle, except when the >contents have changed and need to be redrawn It turns out that Steve was right: I merely assumed that my FilterProc would operate on the Modal Dialog, when in fact I needed to SetPort. Rather embarrassing, but I guess that's how you learn, right? I shall do 1000 CopyBits as penance. :-> Actually, I was (am) trying to get a usrItem to be redrawn often: sort of a bar graph, like the one for disk copying in the Finder. I see now that I can just call the drawProc directly in my ModalDialog's filter proc. Likewise, once the port is set right for the inval, invalRect works fine too. Thanks to all who helped! Much appreciated! Robert ------ ra_robert@gsbacd.uchicago.edu ------ generic disclaimer: all my opinions are mine