[GRASS-dev] debugging nviz with TclTk 8.5 aqua

Glynn Clements glynn at gclements.plus.com
Sun Jul 27 13:12:25 EDT 2008


William Kyngesburye wrote:

> Since the app startup doesn't have access to the user's startup  
> environment, they can't set it before running GRASS.

We could do with having Init.sh explicitly source a file containing
variable settings.

> > Why not just include 2 versions of wish: 8.5 aqua and 8.5 x11.  
> > Switching GRASS_WISH will make the GRASS aqua or x11 compatible.  
> > These are small files and then binary users would not need to worry  
> > about having TclTk installed or which version they have installed.
> 
> I noticed something that could cause trouble in freely switching  
> between aqua and X11 tcltk at runtime.  There is this 'osxaqua' env  
> var (I think it came from Lorenzo a long time ago).  This needs to be  
> set when running the GUI with tcltk aqua.
> 
> In tcl scripts it's used to set keycontrol to the Mac command key and  
> execom to spawn.
> 
> There should be a way to detect the graphics system in tcltk so the  
> user doesn't have to figure it out.  I poked around a bit and found that
> 
> [tk windowingsystem]
> 
> returns 'x11', 'aqua' and 'win32', independent of the platform.  So a  
> combination of $tcl_platform(platform) and [tk windowingsystem] could  
> be used to identify Mac X11 or Aqua.  I did find that [tk  
> windowingsystem] opens a small empty tk window, but it's a place to  
> start and maybe you know how to execute it properly.

Tk itself creates the top-level window.

I have changed gis.m to use "tk windowingsystem" instead of
$env(osxaqua).

> 'osxaqua' is also used once outside of tcl scripts, in init.sh.  It's  
> used to decide whether to pipe the gis.m startup command to "sh &" or  
> not.  I don't know if this really needs to be there, or if a different  
> test could be used.

That code is complete gibberish, and potentially quite dangerous (if
wish writes anything to stdout, the shell will attempt to execute it),
so I have removed it.

ISTR that it's a hack to deal with the case where Init.sh doesn't have
a stdout (i.e. if it's run directly from the desktop rather than from
a terminal).

It may no longer be required with more recent versions of Tcl/Tk (or
more recent versions of OSX). If wish still needs a stdout, it's
probably better to just run the grass70 script with its stdout
redirected to a file.

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


More information about the grass-dev mailing list