Article View: comp.unix.programmer
Article #119Re: Help! Output going everywhere...
From: Shithead II
Date: Sat, 25 Jul 1992 05:00
Date: Sat, 25 Jul 1992 05:00
35 lines
1705 bytes
1705 bytes
In article <1992Jul24.040517.3375@tc.cornell.edu> reed@theory.tc.cornell.edu writes:
>I have a X client (motif widget set being used) that spawns a number of
>childen. Now, since I use fork(), all file descripters are copied over to
>the children. This is fine and dandy, but what I really want is to capture
>the output (stderr & stdout) from the children in a text widget (motif) in
>if I am hung up in an XtMainLoop call (or do I need to change to something
>else [gasp! handle my own events????])? I thought of using a SIGIO signal
>handler, but have been unable to get this to work (then again, it's my first
I *think* the clue is to lose your XtMainLoop() (i.e. don't use it)
and use something like...
if (XtAppPending(ac))
{
XtAppNextEvent(ac, &event);
XtDispatchEvent(&event);
}
else
{
/* do the read_from_pipe_thing() */
}
The XtAppNextEvent() blocks waiting for input so I think you want
the XtAppPending() check...This doesn't really have to been an if/else
...but whatever...
oh...and I think the signals are a no-no (I don't believe they were
designed or intended for interprocess communication...)
Matthew Kerr
Kvam data as
Nikkelveien 14, N-4300 Sandnes, Norway
Tel: + 47 4 62 37 66
Fax: + 47 4 62 39 85
Technical Details
Message-ID:
<1992Jul25.050058.1411@fics.uucp>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!aun.uninett.no!alf.uib.no!hsr.no!fics!mattReferences:
<1992Jul24.040517.3375@tc.cornell.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!aun.uninett.no!alf.uib.no!hsr.no!fics!matt From: matt@fics.uucp (Shithead II) Subject: Re: Help! Output going everywhere... Organization: Kvam data as Date: Sat, 25 Jul 1992 05:00:58 GMT Message-ID: <1992Jul25.050058.1411@fics.uucp> Keywords: pipes, widgets, children References: <1992Jul24.040517.3375@tc.cornell.edu> Lines: 35