Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sun-barr!decwrl!asente From: asente@decwrl.dec.com (Paul Asente) Newsgroups: comp.windows.x Subject: Re: Changing label Message-ID: <1738@bacchus.dec.com> Date: 28 Aug 89 21:12:24 GMT References: <4337@cps3xx.UUCP> <8908281827.AA07142@expo.lcs.mit.edu> Organization: DEC Western Software Lab Lines: 25 In article <8908281827.AA07142@expo.lcs.mit.edu> kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) writes: > >> My problem is : I didn't get message #1 thru #(n-1) on my window, >> but only the LAST message (#n). >> Could anybody help me out with this problem ? > >The X toolkit only processes events in XtMainLoop. Even though you have asked >the label widget to display a new string the event is not sent to the server >until you get into XtMainLoop. A quick fix to the problem is to put an >XFlush() call into your client after the XtSetValues() call... Well, close. When you change the label, the toolkit clears the window to generate expose events. The label actually gets repainted as a result of the expose events, so no repainting will be done until the expose event arrives. Additionally, if you are changing the label several times without processing events in between, by the time the first expose comes back the label has been changed so that it redisplays using the last value, and not the first. The moral of the story is not to use labels for things like this. -paul asente asente@decwrl.dec.com decwrl!asente