Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sdd.hp.com!decwrl!shelby!bloom-beacon!eru!luth!sunic!mcsun!ukc!harrier.ukc.ac.uk!rlh2 From: rlh2@ukc.ac.uk (Richard Hesketh) Newsgroups: comp.windows.x Subject: Re: Widget Refreshing Values ! Message-ID: <5195@harrier.ukc.ac.uk> Date: 28 Jul 90 08:51:52 GMT References: <9007271833.AA26394@metropolis.super.org> Reply-To: rlh2@ukc.ac.uk (Richard Hesketh) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 39 Summary: Expires: Sender: Followup-To: In article <9007271833.AA26394@metropolis.super.org> dsseewe@SUPER.ORG (Daniel Seewer) writes: > > I have noticed a problem updating the values of several widgets >(mostly labels) during one of my callback routines. This is a feature of how Xt does its refreshing of a widget after a SetValues call. If the widget indicates that it requires updating after the SetValues call then the Intrinsics clears the widgets window, which generates an expose event that causes the widget to be *later* redrawn. >Must I dispatch events during this "Big loop" to guarantee updates? Essentially yes. There are two general approaches to what you are doing. You can either get some events and dispatch them during your "Big loop", at a convenient point: while (XtAppPending(app_context)) { XEvent ev; XtAppNextEvent(app_context, &ev); (void)XtDispatchEvent(&ev); } Or you make your "Big loop" a sub-process, with i/o via pipes etc., which leaves the event processing loop to carry on doing its job. The pipe i/o can be handled as an extra event source thus leaving you with only one event processing loop. I find this a much better approach because it allows you to separate the user interface from the application in a fairly clean manner. It also looks really neat when you can cut and paste from output windows while still doing some number crunching 8-). > Dan Seewer > (dsseewe@super.org) Richard Hesketh : @nsfnet-relay.ac.uk:rlh2@ukc.ac.uk : rlh2@ukc.ac.uk ..!mcsun!ukc!rlh2 --- Computing Lab., University of Kent at Canterbury, Canterbury, Kent, CT2 7NF, United Kingdom. Tel: +44 227 764000 ext 7620/3682