[GRASSLIST:2814] Re: NVIZ problems on Mac OSX

Glynn Clements glynn.clements at virgin.net
Thu Dec 20 19:21:08 EST 2001

Nick Cahill wrote:

> Many thanks for your explanation. Is the known problem the <el=xxx> 
> rather than <elevation=xxx>?

No; "el=xxx" is perfectly valid. The problem is that, if Tk_Init()

1. the failure is ignored and,

2. the command-line parser ends up being initialised twice, resulting
in every option being registered twice.

The "el=xxx" argument then matchs both copies of the "elevation"
option, hence the error message claiming that it is "ambiguous".

What should happen is for NVIZ_AppInit() to just return TCL_ERROR,
which would cause a typical Tcl error message to be printed, complete
with a backtrace. This would probably provide some information as to
exactly why Tk_Init() failed.

> If so, why doesn't NVIZ work when called 
> from the command line, with nothing passed to it? Are the errors 
> "Original error: invalid command name "tkScreenChanged",    Error in 
> bgerror: invalid command name "bgerror" and "Error in startup script: 
> invalid command name "tk_menuBar"" fixed in the latest CVS version, 
> or are they due to something else which can't be diagnosed w/o 
> compiling the source and seeing what happens?

If you don't pass any arguments, not only will the Tk_Init() failure
not be reported, but the parser won't generate the "ambiguous" error
either. Instead, nviz will proceed with initialisation, and fail when
it attempts to use Tk functions.

Note: if you pass "elevation=xxx", you are likely to get the same
result. IIRC, the parser only complains about ambiguous options for
abbreviations, but not for an exact match.

I suspect that the underlying error is probably something relatively
straightforward (shared libraries, Tk configuration files not found,
or similar), and could possibly be worked around while using the pre2
binaries, *if* you could find out what the underlying error was.

Actually, that reminds me: I seem to recall that the MacOS X version
of Tk looks for the Tk scripts in directories which are relative to
those containing the executable. E.g. in order for /usr/bin/wish to
look in e.g. /usr/lib/tk8.3 and /usr/local/bin/wish to look in e.g. 
/usr/local/lib/tk8.3, it has the executable look in e.g. ../lib/tk8.3.

Try creating a symlink from $GISBASE/etc/lib/tk8.3 to your Tk
directory (e.g. /usr/lib/tk8.3). Change paths and version number

Glynn Clements <glynn.clements at virgin.net>

More information about the grass-user mailing list