brp@bandit.berkeley.edu (Bruce Raoul Parnas) (02/07/91)
thanx for all the response on getting status messages to users with widgets. in doing this, it occurred to me that i have a deeper question: i have a large computational routine and would like a widget to display status from this. how can i continue to update this window without being in a XtAppMainLoop, XtMainLoop or something similar? The documentation for XtWorkProc seems to indicate that it is for "small" jobs that happen in between requests. I would like to have my procedure be the main job, and be able to output status in a widget. i now send output via printf to the window from which i invoked the routine, and would simply like to redirect this output to a widget that i open, without seriously affecting my ability to perform the main computation. sounds like i want a lot, doesn't it? has anyone done this sort of thing? thanx, bruce (brp@bandit.berkeley.edu)
barmar@think.com (Barry Margolin) (02/07/91)
In article <1991Feb6.223302.25752@agate.berkeley.edu> brp@bandit.berkeley.edu (Bruce Raoul Parnas) writes: > I >would like to have my procedure be the main job, and be able to output status in >a widget. i now send output via printf to the window from which i invoked the >routine, and would simply like to redirect this output to a widget that i open, >without seriously affecting my ability to perform the main computation. If you're using Unix, you could fork a child process that can create the widget. Create a pipe, and use fprintf to send the status into the pipe. The child process reads from the pipe while in its main loop, and copies any input to the widget. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar