[GRASS5] 5.7.0 nviz2.2_script Error

Jeshua Lacock jeshua at OpenOSX.com
Mon Nov 8 15:16:55 EST 2004


On Nov 8, 2004, at 1:04 AM, Glynn Clements wrote:

>
> 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.

I thought that might be what was happening.

> 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;

Thanks Glynn, as always, you rock!


Thanks again,

Jeshua Lacock __________________________
Programmer/Owner            Phone:   877.240.1364
http://OpenOSX.com           Fax:        415.462.6211
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_




More information about the grass-dev mailing list