[GRASS5] Need testers for tcltkgrass update for 5.7

Glynn Clements glynn.clements at virgin.net
Mon Aug 16 09:41:32 EDT 2004


Michael Barton wrote:

> At Hamish's suggestion, I've gone through gui.tcl in tcltkgrass for GRASS
> 5.7 and cleaned out a great deal of code. This code is unused by tcltkgrass
> now that GRASS 5.7 generates interactive dialogs for all commands on the
> fly. 
> 
> It all seems to work fine on my Mac, but I'd appreciate it if some other
> folks test it on other platforms to make sure I haven't removed some
> essential procedure. For those who want to  look at what I've done, I've
> left in the procedure names--commented out--for all procedures I removed.
> There is probably more cleaning that can be done, but this takes care of a
> great deal for starters.

> The only thing that doesn't work is scripting. I'm not sure whether this is
> a function of GRASS 5.7 (and that I should take it out of the menu
> altogether) or it  is simply broken at the moment. If anyone has a clue, let
> me know.

The old tcltkgrass constructed and handled the dialogs itself, so it
got to see the actual command line. The new version simply runs the
command without arguments; the command generates the dialog, reads the
arguments, then re-executes itself, without tcltkgrass ever getting to
see the arguments.

To make tcltkgrass scripting work, G_gui() would need to e.g. write
the Tcl/Tk code to stdout so that it could be executed by tcltkgrass. 
I.e. something like --html-description but which generates Tcl/Tk code
rather than HTML.

> I am attaching the text files gui.tcl and menu.tcl. To test these, make
> copies of the existing gui.tcl and menu.tcl (located in
> $GISBASE/tcltkgrass/main) and replace them with the ones here. Let me know
> if everything works OK. I am using a new text editor that is supposed to
> save these with standard Unix line feeds. They work fine in my version of
> GRASS. However, if anyone has a problem reading these files, let me know.

I have attached modified versions.

I found that the formatting of menu.tcl (specifically, having the
commands on the following line, indented at the same level as the
labels) obscures the structure, so I changed this.

I replaced most commands of the form "exec <cmd> &" with "execute
cmd". This only applies where the command was called without arguments
(where the command will typically call G_gui()). Ultimately, I suspect
that you will need to provide more information than just the name of
the command.

I simplified the menu_build procedure; the main change was to add
dummy arguments to -separator, so every item consists of exactly three
entries. This allows the use of a multi-variable foreach statement,
with each menu item processed in one pass.

BTW, I notice that it's executing r3.mapcalc directly. This program
doesn't use G_parser(), so calling it without arguments isn't going to
work.

-- 
Glynn Clements <glynn.clements at virgin.net>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcltkgrass_test.tar.gz
Type: application/octet-stream
Size: 11747 bytes
Desc: tcltkgrass update
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20040816/acac5ffd/tcltkgrass_test.tar.obj


More information about the grass-dev mailing list