FW: Dynamically changing window size

Conn Copas cvc at itd.dsto.gov.au
Thu Dec 15 21:01:30 EST 1994


Mike Foster writes:
> 
>      However, how can changes in the .grassrc file take effect WITHOUT
> exiting and re-starting GRASS?  A simple Bourne shell script (inspired by
> GIS.sh) as follows does NOT do the job UNLESS Zhian exits, then restarts
> GRASS:
> 
> :
> g.gisenv XDRIVER_HEIGHT=
> g.gisenv XDRIVER_WIDTH=
> export XDRIVER_HEIGHT
> export XDRIVER_WIDTH
> g.gisenv XDRIVER_HEIGHT=$1
> g.gisenv XDRIVER_WIDTH=$2
> export XDRIVER_HEIGHT
> export XDRIVER_WIDTH
> eval `g.gisenv`
> 
> 
> What silly  thing have(n't) we done?
> 
If you change those values at the GRASS prompt and then export them to your
environment, they do indeed take effect. However, if you try to change these
values by calling a script, that shell cannot update the environment of its
parent. You can issue the Unix 'env' command at your GRASS prompt to verify
this.

The relevant GRASS code for all this is
	/src/display/devices/XDRIVER/XDRIVER/Graph_Set.c
It calls the function 'get_user' in order to grab these environment variables
prior to creating a monitor. If you absolutely have to resize the monitor
through a sub-shell, then it looks as if you will have to subvert this code
somehow. 

-- 
Conn V Copas
Information Technology Division
Defence Science and Technology Organisation
PO Box 1500
Salisbury            tel: +61 (0)8 25 95349
SA  5108             fax: +61 (0)8 25 96781
Australia       e-mail: cvc at itd.dsto.gov.au
-------------------------------------------          



More information about the grass-user mailing list