wingrass: launching gui and shell [was: Re: [GRASS-dev] Wingrass and TclTk]

Moritz Lennert mlennert at club.worldonline.be
Thu Nov 1 12:37:47 EDT 2007


On Wed, October 31, 2007 11:29, Benjamin Ducke wrote:
> The start command does actually work to put gis.m in the background.
> I changed init.bat to read:

I propose to do it in this (slightly modified) way:

In init.bat:

===
rem Get LOCATION_NAME to use in prompt
FOR /F "usebackq delims==" %%i IN (`g.gisenv "get=LOCATION_NAME"`) DO @set
LOCATION_NAME=%%i

cd %HOME%
prompt GRASS %GRASS_VERSION% $C%LOCATION_NAME%$F:$P $G
start "GRASS %GRASS_VERSION% Shell" cmd.exe /E:ON /F:ON /V:ON

%WINGISBASE%\bin\gis.m.bat
===

where gis.m.bat simply contains:

===
@ start "GIS Manager" "%GRASS_WISH%" "%WINGISBASE%/etc/gm/gm.tcl"
===

This way we have a functioning gis.m.bat which one can also launch from
the command line if grass was started with in text mode.

Nice also to finally get rid of this empty and useless cmd.exe window we
had before.

Only thing which is a bit annoying: you have to close the two (cmd and
gis.m) seperately (i.e. gis.m does not close when you type exit in
cmd.exe). But that's minor in my eyes.

One question I don't know how to solve, though: just as for other scripts
a gis.m.bat is created during compilation, which contains:

@"%GRASS_SH%" -c '"%GISBASE%/scripts/gis.m" %*'

However, I think that gis.m should run independently of whether someone
has installed a shell, so I'd rather replace this bat file by the one
above. This would mean creating some form of exception for gis.m to the
below entry in include/Make/Script.make:

$(BIN)/$(PGM).bat: $(MODULE_TOPDIR)/scripts/windows_launch.bat^M
        sed -e "s#SCRIPT_NAME#$(PGM)#"
$(MODULE_TOPDIR)/scripts/windows_launch.bat > $@

Is that possible ?

Any other suggestions ?

Moritz




More information about the grass-dev mailing list