How to get fewer Expose events when changing many Widgets

Is there a way to change the background, foreground, etc. of an XmManager and all of its children without generating multiple Expose events? In other words, can I traverse the Widget tree starting from the XmManager and call XClearArea (or a similar function) in the end? Does each individual Widget window need an Expose or would exposing the containing window redraw them all? I know that using XtSetValues can cause multiple Expose events. Would it be better to call the Core and Constraint set_values functions myself and Expose once in the end or is this considered too dangerous? Thanks.


ismailfaruqi

ismailfaruqi's picture

How to get fewer Expose events when changing many Widgets

I'm working on a viewport like widget that has 2000+ children, and my application runs like slug when i have to translate the viewport, because I have to translate 2000+ children in a second. So I change the widget record directly (w->core.x, w->core.y, etc.) and calling XClearArea in the end, then my application runs normal again and the hell is gone.

You can set the compress_exposure of your composite widget to either XtExposeCompressMultiple / XtExposeCompressMaximal, but this way doesn't help too much in my case.

I think there is no other way....