Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ucbvax!winery.DEC.COM!jensen From: jensen@winery.DEC.COM.UUCP Newsgroups: comp.windows.x Subject: re: Handling ExposeWindow events for nested windows Message-ID: <8704101917.AA27651@decwrl.dec.com> Date: Fri, 10-Apr-87 13:46:58 EST Article-I.D.: decwrl.8704101917.AA27651 Posted: Fri Apr 10 13:46:58 1987 Date-Received: Sat, 11-Apr-87 18:15:39 EST Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 27 If you are going to do this under X10, the best approach I have seen is to defer processing Exposure events until you receive an event which is not an expose event (or you run out of events). Then you look at the last exposure event and test to see if it is a resize. If so, discard all the previous exposure events; otherwise process them. Whether this will work for you depends on the nature of the application; you will have to be careful not to discard an exposure event you really need to process. For an example of this, take a look at bitmap.c in the X.V10R4 release, in particular ProcessEvent, ProcessEventReally, and HandleExposure. ProcessEvent makes a call to HandleExposure, which in turn recursively calls itself until the event string terminates. Then if the last exposure event is not a resize, HandleExposure returns with a "PROCESS_IT" status, which will cause the stack to unwind, processing the deferred events (N.B.: in reverse order). Otherwise, HandleExposure returns a "DISCARD_IT" status, causing the deferred events to be thrown away. There are some details I have skipped, but these routines are a good starting point. Regards, /Paul Jensen Western Area Operations Digital Equipment Corp. Santa Clara, CA