Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!linus!agate!ucbvax!osf.org!cliu From: cliu@osf.org ("Chauncy Liu") Newsgroups: comp.windows.x.motif Subject: Re: XmUpdateDisplay fails Message-ID: <9104081512.AA21351@osf.osf.org> Date: 8 Apr 91 15:14:30 GMT References: <1991Apr5.153900.22674@athena.mit.edu> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 51 > I use XmUpdateDisplay to refresh my application before starting a long > load from disk and subsequent calculation. Immediately after > XmUpdateDisplay I call a routine to change the cursor, which calls > XFlush; I see the cursor change, but no screen update. What's wrong? > I think you already received mail form David Brooks, he gave some idea how this is happening. In the workaround, if the time to sleep is short, and the process is huge, this will not guarantee you for a total display update before your process begin (you have to wait till your process end then your display will be updated totally afterward). My suggestion is make a routine to update your display which guarantee display is updated before further process void My_Update_Display_Routine(w) Widget w; { XtAppContext app; Boolean BREAK = False; app = XtDisplayToApplicationContext(XtDisplay(w)); XmUpdateDisplay(w); XClearArea(XtDisplay(w), XtWindow(w), 0, 0, 0, 0, True); for(;!BREAK;) { XEvent event; XtAppNextEvent(app, &event); switch(event.type) { /* Dump all the user generated events at the time of displaying */ case KeyPress : case KeyRelease : case ButtonPress : case ButtonRelease : case MotionNotify : break; case Expose : if (event.xexpose.window == XtWindow(w)) BREAK = True; default : XtDispatchEvent(&event); break; } } XmUpdateDisplay(w); XFlush(XtDisplay(w)); } Hope this helps Chauncy Liu / OSF System Engineer