
PIPE OBJECTS
     The input, output, and pipe objects allow you to connect  an
     xtpanel  to  another UNIX process. An input object waits for
     input from the process, and performs its action(s) each time
     input  is  received. An output object sends information to a
     process. A pipe object combines the features  of  input  and
     output  to give two-way communication; the pipe sends infor-
     mation to the process, and  performs  its  actions  whenever
     information is received back.

     These objects have no screen representation.


     input
        An input object has its action performed when it receives
        input.

        input={ name=... value=... stream=... separator=...  run-
        ning=... action=...  }

        name  defaults to "input1", "input2" etc.

        An input has three special parameters, stream, separator,
        and  running.   stream  is  a  string  that specifies the
        stream to be read. There are two special strings,  "none"
        and  "stdin".  Any  other string will be interpreted as a
        command to be run; the stream used as input will  be  the
        output  of  that  command.   A stream of "none" indicates
        that there is no initial stream associated with the input
        object.  A  stream  can  be associated at a later time by
        using the SET action. A stream specified as "stdin" indi-
        cates  that  input  will  be  read from stdin. If this is
        specified then the -input flag must be  used  to  disable
        parsing of stdin as a script file.

        separator is a string  of  characters  that  is  used  to
        separate  strings  processed  by  the  input  object. The
        action[s] of the input object will be executed  once  for
        each  non-zero  length  string delimeted by characters in
        the separator list. e.g. if the separator  is  "\n"  then
        the action will be executed for each line. If the separa-
        tor is " " then the action  will  be  executed  for  each
        word.  The current value of an input object is the string
        being processed.

        running is a boolean that specifies whether the input  is
        running. Running defaults to True, i.e. it defaults to be
        running.  Using SET an input can be turned off by setting
        its running attribute to False. If an input object is not
        running it will not read any input from its stream  until
        it is turned on again.

        This very simple script will act as a "pager" for  stdin.
        Any  lines  received  on stdin willl be added to the text
        object. Note that this script must be  invoked  with  the
        "-input" flag since it reads from stdin.

        button={ label=DONE action=QUIT }
        text={ name=disp value=" " width=500 height=500 }
        input={ separator="\n" stream=stdin action="ASSIGN disp $(disp)$(val)0 }

        An input object is also useful for allowing external pro-
        grams  to  modify the xtpanel. The following example uses
        the EVAL action  to  interpret  each  input  line  as  an
        xtpanel  action. e.g. The user could type "SET disp fore-
        ground red" and the label would have its foreground color
        changed.

        button={ label=DONE action=QUIT }
        label={ name=disp value="here is some text"  }
        input={ separator="\n" stream=stdin action="EVAL $(val)" }



     output
        An output object sends any values passed to it (using  an
        ASSIGN  action)  on  to its stream, which its typically a
        command.
        output={ name=... stream=... running=... }

        name  defaults to "output1", "output2" etc.

        stream and running are the same as for the input  object,
        with  the  exception  that  the special string "stdin" is
        replaced by "stdout". If the  stream  is  stdout,  values
        assigned  to an output object are sent to xtpanel's stan-
        dard output (though an easier way to accomplish  this  is
        with a PRINT action).

        This simple script is a front end to the "bc" UNIX calcu-
        lator.  Pressing the COMPUTE button sends the contents of
        the text field to bc (using an ASSIGN action). The result
        goes  to  xtpanel's standard output, usually the terminal
        screen.

        button={ name=quit action=QUIT }
        output={ stream="bc" }
        field={ value="2+2" }
        button={ label=COMPUTE action="ASSIGN output1 $(field1)\n" }


     pipe
        A pipe is a combination of the input and output objects.
        A pipe's actions are performed whenever it receives input.
        And any values passed to the pipe (using an ASSIGN action) are
        passed on to the UNIX command to which the pipe is connected.
        Thus pipes enable two-way communication with a UNIX process.

        pipe={ name=... value=... stream=... separator=...  running=... action=...  }

        name  defaults to "pipe1", "pipe2" etc.

        The remaining parameters are the same as for the input object
        described above.

        The following example is another front end to the UNIX calculator
        "bc". In the one shown above for the output object, the result
        went to xtpanel's standard output (usually the terminal screen).
        Because the pipe object allows two-way communication, this example
        gets the result back from bc and stores it in the text field.

        button={ label=DONE action=QUIT }
        field={ value="2+2" }
        button={ label=COMPUTE action="ASSIGN pipe1 $(field1)\n" }
        pipe={ separator="\n" stream="bc -l" action="ASSIGN field1 $(val)" }
