wingrass: launching gui and shell [was: Re: [GRASS-dev] Wingrass
and TclTk]
Glynn Clements
glynn at gclements.plus.com
Thu Nov 1 22:58:28 EDT 2007
Paul Kelly 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
> > ===
>
> I'm trying to follow what's going on here but it's bit confusing - would
> help if somebody posted a diff of the proposed changes to init.bat (the
> usual way). Have a few comments anyway about my original philosophy of why
> init.bat does things the way it does, which hopefully might help clarify
> things.
>
> There is not supposed to be a command-prompt running separately from that
> included in gis.m - I thought we were moving towards the idea of having a
> command prompt built into the gronsole Window and using that (I think it's
> improved further in wxgrass) - so that was the point of that. I think it
> is confusing for new users having to type exit in a command Window to
> totally exit GRASS as well as just going File-->Exit in the GUI menus (is
> that what's being proposed here?).
>
> If somebody wants a GUI and console then I think it's OK to require them
> to start GRASS in text mode and run gis.m from the command prompt. So I
> actually think Moritz's new gis.m.bat is a really good idea. I just was
> too lazy to get round to implementing that before. And there was some
> complication about the way the gis.m Shell script was generated although I
> think I simplified things a little bit.
For Windows, we should probably install separate .bat files (and
shortcuts on the Start Menu, if possible) for GUI-only, console-only
and GUI+console modes.
> Also I'm not sure what the "cd %HOME%" is for. GRASS on Unix doesn't
> change the directory you were in before starting it AFAIK - why should it
> on Windows?
Windows users will probably want to start GRASS from a shortcut rather
than from a console. By default, the current directory will be the one
containing the batch file.
We may be able to solve the problem by providing our own shortcuts
which start in the user's home directory (I *think* that you can use
environment variables in that field).
If the user starts GRASS from an existing console, they probably don't
want to change the current directory.
> > Nice also to finally get rid of this empty and useless cmd.exe window we
> > had before.
>
> Do you mean with the changes the init.bat script is exiting/abandoning
> after starting gis.m? The whole point of it staying running (and as a
> side-effect keeping a command prompt Window open - I don't know how to
> hide that but I presume it's possible)
The "start" command has a flag to hide the console window.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list