Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!accuvax.nwu.edu!tank!ra_robert@gsbacd.uchicago.edu From: ra_robert@gsbacd.uchicago.edu Newsgroups: comp.sys.mac.programmer Subject: Getting usrItem to draw itself during ModalDialog Message-ID: <2580@tank.uchicago.edu> Date: 3 Apr 89 15:27:56 GMT Sender: news@tank.uchicago.edu Distribution: na Organization: University of Chicago Graduate School of Business Lines: 46 I'm having a problem getting a usrItem in a dialog to be drawn. Specifically, I want to draw a bar graph which gets filled in (like the one you see now when you copy files from one disk to another in the Finder). To summarize, I generate (or try to generate) an update event from my modalDialog's filter by invaling my usrItem's rect, hoping this will force ModalDialog to handle the update event, and call my usrItem's draw proc, getting the thing redrawn. So this would be my modal Dialog filter: function theFilt (theDialogPtr: DialogPtr; var theEvent: EventRecord; var itemHit: integer): BOOLEAN; var itemBox: rect; itemHandle: handle; itemType: integer; refcon: longint; theString: Str255; begin theFilt := FALSE; refcon := GetWRefCon(theDialogPtr); GetDItem(theDialogPtr, DialogTwo_BarGraphItem, itemType, itemHandle, itemBox); {get box containing barGraph} InvalRect(itemBox); {inval our barGraph's box, forcing it to be redrawn} SetWRefCon(theDialogPtr, refcon + 1); end; This doesn't work; updateEvents don't seem to be generated, and the usrItem doesn't get redrawn. Why wouldn't this work? I know I could call my usrItem's draw proc from within my filter, but I thought this should work too. Everything else is set up fine (setting ports, passing correct params). Any info -- emailed or posted -- much appreciated. Thanks, Robert ------ ra_robert@gsbacd.uchicago.edu ------ generic disclaimer: all my opinions are mine