[GRASS5] 5.7.0 nviz2.2_script Error

Glynn Clements glynn at gclements.plus.com
Mon Nov 8 03:04:40 EST 2004


Jeshua Lacock wrote:

> With 5.7.0, if I invoke "nviz -q", it works fine. If I start nviz with 
> no arguments, it starts a wish GUI titled "nviz2.2_script", if I choose 
> a raster and hit "Run", I get a dialog stating: "Error: can not find 
> channel named "couldn't execute "nviz_2.2_script": no such file or 
> directory". similarly, if I choose the "Display" - > "Start NVIZ ()" 
> from the Tcl/Tk GUI I get the same error:
> 
> can not find channel named "couldn't execute "nviz2.2_script": no such 
> file or directory"
> can not find channel named "couldn't execute "nviz2.2_script": no such 
> file or directory"
> while executing
> "fconfigure $msg -blocking 0"
> invoked from within
> ".run invoke"
> ("uplevel" body line 1)
> invoked from within
> "uplevel #0 [list $w invoke]"
> (procedure "tk::ButtonUp" line 23)
> invoked from within
> "tk::ButtonUp .run"
> (command bound to event)
> 
> I have looked around a bit and I cannot find what would cause the 
> problem. Any hints would be appreciated.

In 5.7, the default "interactive" behaviour (when you run a command
without arguments) is to spawn "wish", feed it Tcl/Tk code which
generates an options dialog, then exit. When you press the "Run"
button, the Tcl/Tk code re-executes the program with the selected
options.

The name of the program is taken from argv[0], as passed to
G_parser(). For a typical GRASS module written in C, this is correct. 
For NVIZ, it appears to be nviz2.2_script. This isn't in the path, and
even if it was, it can't be executed directly.

One possibility is to "fix" argv in parse_command() (in nviz_init.c),
so that argv[0] is "nviz", e.g.

	char *saved_argv0 = argv[0];

	...

	argv[0] = "nviz";

	if (G_parser(argc, new_argv))
		exit(0);

	argv[0] = saved_argv0;

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list