Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!decwrl!bacchus.pa.dec.com!shodha.dec.com!gsrc.enet.dec.com!west From: west@gsrc.enet.dec.com (Jim West (Stealth Contractor)) Newsgroups: comp.windows.x Subject: Re: How do I avoid a flood of Expose events? Message-ID: <1591@shodha.dec.com> Date: 27 Aug 90 15:01:02 GMT Sender: news@shodha.dec.com Organization: Digital Equipment Corporation Lines: 37 In article <1990Aug25.002403.1804@veritas.uucp>, geoff@veritas.uucp (Geoffrey Leach) writes... >I could use some advice on the following situation. Environment is X11R3. > >I have a widget that sits beneath a bunch of other widgets. Even though >I elect event compression, building the stack results in a flood of >expose events for the widget on the bottom, with resultant redundant >re-drawing. How can I detect or avoid them? Is this a widget that you are writing/wrote or just using ? In either case when you receive the event you can check to see what kind of event it is. If it is an expose event then the event structure will contain an element that holds the value of how many more expose events are to follow for that series. If you just using widgets then only do an XtDispatchEvent on the last expose event. If you are getting several independent series of expose events then you could do something like, just hold the latest one and after some period of time dispatch it. Granted, things like this are band-aids/kludges but do work in the case you mentioned. ---------------------------------------------------------------------- Jim West | The Schainker Converse west@gsrc.enet.dec.com | to Hoare's Law : | These are my opinions. | Inside every small problem Digital has no idea | is a larger problem struggling what I'm saying. | to get out. ----------------------------------------------------------------------