Getting back to CheckForInterrupt(), if the user presses the Stop in the dialog, the event is processed and the
stop() callback routine is invoked. This routine simply sets the global variable stopped to True. By the time that
CheckForInterrupt() is ready to return, stopped has been set, so the function returns True. If the
WorkingDialog does not have a Stop button, the callback routine is not installed, so stopped is never set to True.
After the get_busy() routine finishes processing, it calls TimeoutCursors() again to unlock the application.
When on is set to False, the routine uses XCheckMaskEvent() to look in the event queue for button and
keyboard events. In this case, the events are thrown away, since the input is no longer useful. The routine also
destroys the WorkingDialog. In one sense, TimeoutCursors() implements a kind of modality, similar to that
discussed in Section #smodaldlg. However, modality alone cannot provide the functionality necessary to handle
long−running tasks.
22.2.4 Updating the Display
As discussed earlier, XmUpdateDisplay() checks the event queue for all Expose events and processes them
immediately. However, there are some circumstances under which the routine does not work as you might expect. For
example, let's say that your application creates and posts a dialog that contains a DrawingArea widget. You call
XSync() and XmUpdateDisplay() to make sure that the dialog is on the screen and fully exposed. After you call
XClearWindow() to make sure the window is clear, ...