Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!hub!6500stom From: 6500stom@hub.UUCP Newsgroups: comp.sys.mac.programmer Subject: Re: Popupmenu CDEF Message-ID: <3417@hub.UUCP> Date: 24 Dec 89 06:57:57 GMT Sender: news@hub.UUCP Lines: 61 >>>>If anyone is interested I could explain how I eradicated the flicker. >>> Sure, I don't even know what flicker you mean. I read this group to >>> learn, though. >>...The flicker would >>occur if you click on the popupmenu so fast that the menu doesn't >>actually pop up, if they haven't fix it... > The pop-ups do flicker in this way in the Comm. Toolbox configuration > dialogs. But I don't see why it's really a problem. This is not a > normal usage mode, it's an error mode, and it doesn't do anything > confusing or unexpected when the user makes the error. But let's hear > how you got rid of it... Oh good. My popupmenu CDEF wont be completely outdated. The problem looks like this, when TrackControl is called the Contrl Mgr issues the following messages to the CDEF: (from MacTutor, Jan '89, p 11) init testCntl drawCntl loop autoTrack testCntl after mouseup autoTrack drawCntl The problem is that when the popup gets a draw message it needs to draw the whole popupmenu. This might not sound disasterous but look at the messages again. The CDEF gets drawn once during init and once after mouseup. If the selection wasn't changed in the autoTrack, we get a lot of flicker. Now this isn't such a terrible this except that I can't stand it... and I think a lot of people agree with my assessment of flicker. The solution is rather involved. The CDEF needs to know that it should ignore any draw messages during a TrackControl unless the autoTrack routine bids it (ie, the selection has changed and updating is needed). The first method I used was to set up a flag in the contrlData field of the ControlRecord. Then the application could flip this flag on just before the TrackControl and off just after. If the flag was set the draw routine simply didn't draw unless it was called by the autoTrack routine. This method worked great except if you let the Dialog Mgr deal with the CDEF itself. You see, the Dialog Mgr doesn't know that it should flip flags. The latest method works like this: my CDEF patches the TrackControl routine so that I can warn the draw routine not to draw. I wont bore you with the details but everything falls into place nicely. The patch isn't a tail patch and I remove the patch as soon as it wont be needed anymore. I conceed that this method isn't compat. consious as the first method put its more elegant from the programmer's point of view. / Josh Pritikin T It takes real genus to see \ | Internet: 6500stom@ucsbuxa.ucsb.edu | the obvious. | | AppleLink: Josh.P | Just don't say no if they | \ GEnie: J.Pritikin ! don't ask you. /