Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!cornell!rochester!pt.cs.cmu.edu!henry.ece.cmu.edu!hairston From: hairston@henry.ece.cmu.edu (David Hairston) Newsgroups: comp.sys.mac.programmer Subject: Re: Unexpected Update Events Message-ID: <12846@pt.cs.cmu.edu> Date: 30 Apr 91 00:27:01 GMT References: <11082@bunny.GTE.COM> <1991Apr29.170744.12029@news.iastate.edu> Organization: Gaia II Lines: 34 [CAH0@bunny.gte.com (Chuck Hoffman) writes:] [] Using THINK C 4.0, and its Debugger, I've written a short program with [] three windows open. With the Debugger, I'm finding that about every [] second there is an update event generated for one or the other of the [] second and third windows. I get all the update events I expect; these are [niko@iastate.edu (Schuessler Nikolaus E) writes:] [] I was writing a game and it only had one window. I had it redraw the [] screen every time there was an update event... Same problem! There [] were so many update events that that the screen constantly flickered [] while it was doing the updating... [] [] doesn't GetNextEvent remove the event? [] Do you HAVE to use the BEGIN UPDATE and END UPDATE procedures to [] get it to stop? hmm, there may be two problems here: 1) i think the debugger windows, when activated, will cause invalidation of your application windows thus generating update events. i'm not sure about this, tho. 2) do you have to use BeginUpdate(), EndUpdate()? well technically no but only if you know what you're doing (and even then it isn't the wisest thing to do ;). Basically when a windows updateRgn is not empty, it will get an update event. BeginUpdate() and EndUpdate() manage this in a smart way. For more details, read IM-I Chap. 9, The Window Manager and specifically "How a Window is Drawn". GetNextEvent/WaitNextEvent will remove the event from the queue but won't remove the reason the event is getting generated, hence the continuing generation of those events. -dave- hairston@henry.ece.cmu.edu