[GRASS5] Need testers for tcltkgrass update for 5.7
Glynn Clements
glynn.clements at virgin.net
Tue Aug 17 15:03:43 EDT 2004
Moritz Lennert wrote:
> > The d.mon commands are run with arguments. They should complete more
> > or less immediately, and so shouldn't need to be run in the
> > background.
>
> I have the feeling the problem might be the output of the d.mon command.
> The actual tcl error message I get is:
>
> using default visual which is TrueColor
> ncolors: 16777216
> Graphics driver [x0] started
> using default visual which is TrueColor
> ncolors: 16777216
> Graphics driver [x0] started
> while executing
> "exec d.mon start=x0"
>
> Maybe tcl cannot handle the output (first two lines of the error message) ?
Ok; the exec(n) manpage says:
If any of the commands writes to its standard error file and
that standard error isn't redirected, then exec will return an
error
So, they should probably be run with e.g.:
exec d.mon start=x0 2> /dev/null
or:
exec d.mon start=x0 2>@ stdout
Again, this form of command execution should probably be wrapped up
into a procedure, e.g.:
proc run {cmd args} {
eval exec -- $cmd $args 2>@ stdout
}
[However, there's already a procedure named "run", which starts a
command with its own xterm; that's currently only used for
r.le.setup.]
Essentially, we at least need one procedure for executing commands
which will end up calling G_gui() (so that we only have one place in
tcltkgrass which needs to be changed if we were to make G_gui() send
the Tcl/Tk code back to tcltkgrass for execution) and another one for
non-interactive commands such as "d.mon start=...". For now, anything
which doesn't fit those two cases can just use Tcl's exec directly.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev
mailing list