Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!snorkelwacker!bloom-beacon!MAPS.CS.CMU.EDU!Matthew.Diamond From: Matthew.Diamond@MAPS.CS.CMU.EDU Newsgroups: comp.windows.x Subject: Forcing application to process events Message-ID: <9002011609.AA05640@ATHENA.MIT.EDU> Date: 1 Feb 90 16:08:03 GMT Sender: root@athena.mit.edu (Wizard A. Root) Organization: The Internet Lines: 39 > Re: Beginner question: forcing update of labelWidget display > ... > The problem is that the XtSetValues() call clears the Label Widget's window, > and tells that X Server to generate an exposure event for that window. The > window will not actually get painted until your code drops back into > XtAppMainLoop() and resumes processing events. > > Can you work around this? Yes, but its pretty ugly, and could cause your > application to hang. I would suggest that you would be better served by > looking to a more event-driven model for you application. > Speaking for myself, I would be interested in hearing what the work-around is. I am writing a user-interface which is supposed to be interchangeable with an existing user-interface. The idea is that we take applications that use the old, textual interface, link them with my libraries instead, and then they have a mouse-driven, graphical interface, with no change to the application's code. The problem is that these applications were not written to the event-driven model. I can process events whenever my code is called (most user I/O is handled by me, since I am replacing keyboard procedures with code that accepts input from the mouse too). But there are times when my code is not being called and the application's display freezes for a while. I attempted to use XtAddTimeOut() to add an event-loop that would be run periodically, but of course I found that timeouts are handled in the event-loop, they are not true interrupts. Our group may find that we can live with this problem, or I may try using Unix interrupts to periodically interrupt the application, forcing it to process certain events (i.e. Expose) before continuing. But if there is another way, I'd like to hear it. Matthew Diamond MAPS Project, Carnegie-Mellon University matt@maps.cs.cmu.edu