[GRASS5] Re: [GRASSLIST:3781] minor update to tcltkgrass for
GRASS 5.7
Hamish
hamish_nospam at yahoo.com
Sun Aug 1 03:32:46 EDT 2004
> for the archives:
> To debug the tcl code, I had to add a line to parser.c just before
> system(cmd);
>
> sprintf(stdout, "%s\n", cmd);
> [perhaps this should be a if(DEBUG=3) command?]
ummm; yeah... it's already in there.
g.gisenv set="DEBUG=1"
> then run
>
> GRASS:~> d.text.freetype > dtf_tcl.txt
>
> then edit 'dtf_tcl.txt' to remove the "| wish &" from the end.
..
> then 'wish < dtf_tcl.txt' to test it.
>
>
> It was easiest to fiddle with dtf.tcl until it was right and then go
> back and fix parser.c to provide what was needed.
>
>
>
> References:
> "Is white space significant in Tcl" http://wiki.tcl.tk/981
> "Tcl quoting hell" http://wiki.tcl.tk/1726
> "1 minute intro to tcl" http://www.pconline.com/~erc/tcl.htm
>
>
> Next big bug is to get the Tcl menus to honour white spaces:
>
> d.vect where="ident='foo' and location='bar'"
>
> prints out to the stdout window with the double quotes when you click
> "Run", but they get stripped before the command is run causing it to
> break.
I'd guess the problem would be in here somehwere?
button .run -text "Run" -command {
global outtext pipe
set cmd [ mkcmd ]
$outtext insert end "\n$cmd\n"
$outtext yview end
set cmd "| $cmd 2>@ stdout"
catch {open $cmd r} msg
fconfigure $msg -blocking 0
fileevent $msg readable [ list prnout $msg ]
update idletasks
}
?,
Hamish
More information about the grass-dev
mailing list