[GRASS5] New initialization code
Justin Hickey
jhickey at hpcc.nectec.or.th
Tue Nov 28 22:46:11 EST 2000
Hello all GUI concerned members
First of all some history. Way back when Markus and I first discussed
the new initialization script we agreed that grass should start in GUI
mode if possible. I thought the e-mail was posted to the developers list
but since no one complained then, it must have been only private mail.
Sorry for that.
The reason for starting up in GUI mode is as Markus claims, average
users prefer GUI interfaces as compared to text based or command line
interfaces. This concept has been shown to be a basic software
engineering principle (at least that is what I remember from my
courses). Thus, I think it is reasonable to assume that if Grass starts
in GUI mode by default it will be more attractive to new users as well
as current users who do not like the text location/mapset selection
interface (I have had several users ask me if this "intro" screen can be
changed). Can we agree on this principle?
If we can, then the problem is not whether grass starts in GUI mode or
text mode by default, but how can we determine if tcltkgrass will start
properly. Along those lines, I included code in init.sh that would
revert back to text mode if wish was not found. This was based on
Markus' code (correct me if I'm wrong Markus) that tried to search for
wish8.*. Apparently, this code is not working in all cases and appears
to have some flaws. Furthermore, it seems there is not a clear
indication of how we can determine if tcltkgrass will start properly,
especially concerning Windows.
A simple way that can be used on UNIX machines is to check if "wish" is
in the user's PATH. I agree with Andreas that if there is no wish link
to wish8.* then the Tk system was not installed properly. I have code
that can search for a command in a PATH so we can easily implement this.
We can even add a message to indicate that GUI mode is not supported
suggesting the user to check with the sysadm for the existance of wish.
As for having a valid wish version, once we determine there is a wish
command we can have code in tcltkgrass that will check for a minimum
required wish version. I have seen this done in another Tcl/Tk program
(Tkman) and we can use similar code to what is in there. I'm not sure
exactly how it worked, but it seems to be feasible.
For Windows machines, it appears that tcltkgrass does not even work in
that environment yet (is this right Andreas?). In this case, we should
be able to detect a Windows operating system (using uname perhaps?) and
revert back to text mode until tcltkgrass can run in Windows.
I am not familiar with why we had to search for wish8.* or with the bit
of code (the next line restarts using wish thing) that Andreas posted
below, so maybe my suggestion is naive and doesn't account for all the
problems. But I feel the above suggestion is reasonable and as far as I
can see should work.
Regarding the desire to have grass5 start in text mode for seasoned
users (without a flag), I would prefer that the user start grass the
first time with grass5 -text. Then if this is detected, the following
line will be appended to the user's bashrc, cshrc, etc.
alias grass5 'grass5 -text'
The user could also create the alias beforehand, thus never needing to
use "grass5 -text".
The only thing I would need to check is overriding with "grass5 -tcltk".
However, I am pretty sure there is a way to do this. Note that this is
only my preference and I will implement whatever method the list agrees
to. And yes, Markus, your solution is feasable as well.
That's just my 2 cents worth.
Andreas Lange wrote:
> My only fear is that users install the new GRASS and rush out to start
> "grass5" as outlined in all documentation and get:
> on Linux the very nice new startup sceen (happy user!)
> on Cygwin/Win32: a popup-window that says something like:
> --- -geometry xxxyy: no such command ...
> OK Cancel Trace ....
> (completely lost and confused user, will think that GRASS is
> non-usable!)
> other UNIX systems:
> either startup screen (ok!)
> or:
> wish8.0: no such file ...
> (confused user!).
>
> Please consider that even most Linux users today are no Unix/Linux
> gurus.
>
> I think best would be:
> grass5 -> start shell login, echo message on how to start tcltkgrass
> and how to start with grass5 -tcltk
> If user starts with grass5 -tcltk save this in the ~/grass5rc and
> startup tcltkgrass next time.
> The other way round as Markus proposed.
>
> The problem will be IMHO that under the cygwin setup there is a wish
> shell, but this will not work with tcltkgrass for reasons i have
> explained several times (itkwish uses Win API and runs in cygwin
> environment, so that all X11 related geometry/window options are not
> available and ps/kill etc. will not work the same as in Unix
> environments).
>
> And again for the wish-path:
>
> why not use this fragment:
> #!/bin/sh
> # the next line restarts using wish \
> exec wish "$0" "$@"
>
> for all modules? There may be a more complicated version of this
> around, but this would do IMHO.
> A short explanation how the user can add the wish-path to her/his
> executable path would suffice in this case. If there is no link from
> wish8.x to wish the system is broken, not GRASS.
>
> > >
> > > A proposal:
> > > We keep the graphical startup as default, *but*, if the users
> > > starts:
> > > grass5 -text
> > > this is stored as new default in .grassrc5. Next time simply
> > > grass5
> > > would start GRASS in *text* mode. Of course the new default would
> > > be overridden if
> > > grass5 -tcltk
> > > was started. Like that only once the user's preference has to be
> > > set, and all can feel happy :-)
> > > What about this idea as a compromise (if it's feasible, hi
> > > Justin)?
> > >
> > > Markus
> > >
> >
> > Happy proposal :-)
> >
> > Huidae Cho
--
Sincerely,
Jazzman (a.k.a. Justin Hickey) e-mail: jhickey at hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
==================================================================
People who think they know everything are very irritating to those
of us who do. ---Anonymous
Jazz and Trek Rule!!!
==================================================================
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'
More information about the grass-dev
mailing list