At 14:09 17-04-97 +0200, you wrote:
>
>
>Hello,
>
>I do not know, what kind of application you want to start. If they are
>external applications which have to be started via the Tcl command `exec' you
>may simply add a `&' on the end of the exec statement (e.g.: exec
>some_external_script.sh &).
>
>Of course, that works only, if you does not need the output of the started
>command. If you need the output, it is more complicate a little bit.
>
>For example:   ...
>               set pipe [open "|ls -lt $env(HOME)" r]
>               fileevent $pipe readable [list workOnOutput $pipe]
>               ... 
>
>whereby workOnOutput is a Tcl procedure like for example:
>
>               proc workOnOutput {pipe} {
>                  if [eof $pipe] {
>                     catch {close $pipe}
>                  } else {
>                     gets $pipe line
>                     ... ;# do something with the line
>                  } ;# if
>               } ;# workOnOutput
>
>However, you should take sorrow, that the command delivers its output line per
>line for that example, as the process will be suspended on the `gets' command,
>if not a complete line can be read in until the line is complete (ends with
>'\n').
>
>If you, however, want to perform Tcl procs via button activation, that cannot
>be done so easy. But if you use TclX (Extented Tcl) you are able to use the
>`fork' system call to perform parallel execution.
>

Sounds like you are inventing a "toolbar" -- in other words, here is a list
of things you might want to do, separately or together,  press a button.

I would code a callback procedure for each button.  Next I would code a
utility procedure that "launches a command as a background process" and call
this utility from each of your callback procedures.  The utility routine is
simply:

    proc LaunchCommand { verb options } {
        set status [ catch "exec $verb $options" output ]
        if { $status == 0 } {
            #=== the command was successful
            return $output
        } else {
            return "ERROR"
        }
    }
============================================================================
========
  "In a dragon fight, often times, the bleachers get scorched."
  ... let The GRILLON Group help you slay your dragons.  Call Today.
============================================================================
========
    Daniel M. St.Andre'                         The GRILLON Group
    voice:  512.331.8271                        Information Management
Consultants
    fax:    512.331.8915                        10511 Weller Drive
    ofc email:   [EMAIL PROTECTED]          Austin, TX 78750  USA
============================================================================
========

Reply via email to