[GRASS-user] r.reclass not spawning xterm on Mac OS X

Michael Barton michael.barton at asu.edu
Wed Nov 8 23:31:26 EST 2006


I'd forgotten about this environmental variable. So I tried it out to remind
myself how it worked. Overall, it isn't much of an advantage, at least in
the case of r.reclass and absolutely will not work in the TclTk GUI.

What is does is put the command back into the old interactive terminal mode.
So for r.reclass, if GRASS_UI_TERM=0, you need to type ...

r.reclass input=[old_map] output=[new_map]

...to get to the interactive terminal screen where you can put in reclass
statements.

If GRASS_UI_TERM=1 and you simply type r.reclass, you are prompted in the
terminal to enter the [old_map] and [new_map] before you can get to the same
terminal screen to put in reclass statements.

Because it requires interactive xterm use (query/response), it cannot be
used in the TclTk GUI platform.

Oh well. 

It is a very useful module, IMHO, because it offers the chance to maintain
multiple views of a raster map and use only a tiny bit of disk space.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton



> From: Hamish <hamish_nospam at yahoo.com>
> Date: Thu, 9 Nov 2006 17:14:46 +1300
> To: Michael Barton <michael.barton at asu.edu>
> Cc: <dechant at nature.berkeley.edu>, <grassuser at grass.itc.it>
> Subject: Re: [GRASS-user] r.reclass not spawning xterm on Mac OS X
> 
>>> I've been trying to run r.reclass on my G5 using the precompiled
>>> binary for 6.2 and the Mac OS X frameworks (ActiveTcl, too).
>>> Running r.reclass from the terminal spawns a GUI window, into which
>>> I enter the raster layer and the result's name.  After pressing
>>> "run", no xterm window spawns to allow me to interactively set the
>>> rules.  Is there any way to solve this?
> 
> Michael Barton wrote:
>> You have to run r.reclass with arguments to get to the xterm
>> interface. From the GIS Manager, there is a script that does this.
>> 
>> Running r.reclass without arguments will open a GUI that is pretty
>> useless.
> 
> the general solution to this is to force the module not to run in GUI
> mode by setting the GRASS_UI_TERM enviro variable.
> 
> e.g., from r.digit:
> 
>     /* must run in a term window */
>     G_putenv("GRASS_UI_TERM","1");
> 
>     /* Initialize the GIS calls */
>     G_gisinit(argv[0]) ;
> 
> 
> then in menu.tcl:
>    -command {term r.digit }}
> 
> 
> no need for wrapper scripts this way..
> 
> I don't use r.reclass so can't really comment on whether that is the
> best thing for the module. (is it always interactive in a terminal?)
> 
> 
> 
> Hamish




More information about the grass-user mailing list