Submitted by Anonymous on Sat, 03/10/2001 - 14:50. Developers
how to refresh a window when my program does lots of works in background ?
(sorry for my english, i`m french)
Mon, 07/02/2012 - 12:47
#1
Refresh
Si les traitements sont autres que des evenements X, il faut de temps en temps appeler les fonctions de traitement des ?v?nements X (XtDispatchEvent, XtProcessEvent).
Sinon utilise XFlush pour forcer le traitment des ?v?nements X en cours.
Pardon my French, or lack of it.
XFlush() merely flushes requests to the X server. It does not handle those events.
XmUpdateDisplay() handles exposure (and only exposure) events.
There is an article about another approach at http//www.motifzone.com/tmd/articles/quick_flush/refresh.html , but pay attention to the caveats.
The best solution is to break the problem up into smaller chunks, so that the application isn`t computation-bound. These chunks can be put into work procedures (see http//www.motifzone.com/resources/man/XtAppAddWorkProc.html). Or, the lengthy computation can be put into a separate process or a separate thread.