[GRASS5] New initialization code

Hello all

I have just commited code to CVS for a new initialization script. Please
update the src/general/init and src/tcltkgrass directories and then run
gmake5 in these two directories. This should (I hope) create a new
grass5 script.

The new script will use tcltkgrass by default and bring up a window to
ask for the Location and Mapset. If wish is not found on the system, it
will default to the old text interface. Also flags can be passed to
grass5 to indicate which interface you want.

grass5 -tcltk => Tcl/Tk interface
grass5 -text => text based interface

For those who choose the text based interface but still want to run
tcltkgrass just type tcltkgrass as always.

Finally a help flag is also available for the grass5 script, valid flags
are "-h", "-help", "--help", and "help". Huidae, could you please edit
the src/general/init/grass.src file to update the usage message to
comply with the flags you added to start grass given default locations
and mapsets? I could not remember how you intended the flags to be used.

Note that this is only a simple interface for the grass 5 stable
release. I am still working on a more detailed interface for grass 5.1.

As always, please send any problems or comments to this list.

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@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@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Okay, here's a little bug report and a track down of the problem.

I get this output:

Starting GRASS ...
Error in startup script: couldn't read file "wish8.2": no such file or
directory
/usr/local/grass5/etc/Init.sh: [: ==: unary operator expected
/usr/local/grass5/etc/Init.sh: [: ==: unary operator expected
/usr/local/grass5/etc/Init.sh: GISDBASE: parameter null or not set

But the problem stems from the finding of the "wish" command. On my
system I have "wish", "wish8.0", "wish8.2" and "wish8.3". "wish" is a
symbolic link the eventually points back to "wish8.3" (as the
preferential "wish"). The others are there because some programs are
built against older versions of Tcl/Tk. There *might* be a fairly
straightforward solution for this. In the configure.in, I grep tcl.h or
tk.h for the '#define TK_VERSION "x.x"' string. I use this to attempt
linking/validation of libraries. This information could easily be
passed down the Makefile chain and *should* obviate the need to search
for a particular "wish". Perhaps this would be a problem for a binary
compilation using one version of tcl/tk and a user who has a different
version. Anyway, I could easily export that variable if it will help.
Though, I wonder if it wouldn't be safer just to try "wish"?

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Eric

"Eric G . Miller" wrote:

Starting GRASS ...
Error in startup script: couldn't read file "wish8.2": no such file or
directory
/usr/local/grass5/etc/Init.sh: [: ==: unary operator expected
/usr/local/grass5/etc/Init.sh: [: ==: unary operator expected
/usr/local/grass5/etc/Init.sh: GISDBASE: parameter null or not set

But the problem stems from the finding of the "wish" command. On my
system I have "wish", "wish8.0", "wish8.2" and "wish8.3". "wish" is a
symbolic link the eventually points back to "wish8.3" (as the
preferential "wish"). The others are there because some programs are
built against older versions of Tcl/Tk. There *might* be a fairly
straightforward solution for this. In the configure.in, I grep tcl.h
or tk.h for the '#define TK_VERSION "x.x"' string. I use this to
attempt linking/validation of libraries. This information could
easily be passed down the Makefile chain and *should* obviate the need
to search for a particular "wish". Perhaps this would be a problem
for a binary compilation using one version of tcl/tk and a user who
has a different version. Anyway, I could easily export that variable
if it will help. Though, I wonder if it wouldn't be safer just to try
"wish"?

Thanks for the report Eric. Markus, this is more your area than mine.
Any idea for fixing this?

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@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@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Justin,

On Tue, Nov 28, 2000 at 12:45:01PM +0700, Justin Hickey wrote:

Hello all

I have just commited code to CVS for a new initialization script. Please
update the src/general/init and src/tcltkgrass directories and then run
gmake5 in these two directories. This should (I hope) create a new
grass5 script.

it's working excellent!

Note: Those being using the new configure.in may mv the new startup from
$GISBASE/bin to /usr/[local/]bin.

The new script will use tcltkgrass by default and bring up a window to
ask for the Location and Mapset. If wish is not found on the system, it
will default to the old text interface. Also flags can be passed to
grass5 to indicate which interface you want.

grass5 -tcltk => Tcl/Tk interface
grass5 -text => text based interface

For those who choose the text based interface but still want to run
tcltkgrass just type tcltkgrass as always.

Working well. There is only one strange thing (not too important):

If I am within the GRASS shell, the "cd" does not bring me home any
more.

Another suggestion:
Please add a line about tcltkgrass on text welcome screen:

[...]
Help is available with the command: g.help
See the licence terms with: g.version
Start the graphical user interface with: tcltkgrass& <-!
When ready to quit enter: exit

or something like this as a reminder.

Another thing: When starting
grass5 -text
and starting tcltkgrass within GRASS shell, the file
$HOME/.tcltkgrass
is not read. If I start
grass5
or
grass5 -tcltk

it is read.

However these are minor things only.

Finally a help flag is also available for the grass5 script, valid flags
are "-h", "-help", "--help", and "help". Huidae, could you please edit
the src/general/init/grass.src file to update the usage message to
comply with the flags you added to start grass given default locations
and mapsets? I could not remember how you intended the flags to be used.

Note that this is only a simple interface for the grass 5 stable
release. I am still working on a more detailed interface for grass 5.1.

As always, please send any problems or comments to this list.

Thanks for your work, Justin,

it seems to be time to publish GRASS 5 beta9 now!

Yours

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Justin, Hi all,

Justin Hickey wrote:

The new script will use tcltkgrass by default and bring up a window to
ask for the Location and Mapset. If wish is not found on the system, it
will default to the old text interface. Also flags can be passed to
grass5 to indicate which interface you want.

This will IMHO render the cygwin "port" almost useless, as there is no
tcltkgrass until now. There is a wish (could not test this right now),
but it does not work with the tcltkgrass code. I tried to start
tcltkgrass within the cygwin grass shell, but i got only an error window
from wish stating that something is wrong. I remember that all
x11-specific calls will not work with the windows wish, as the geometry
things are implemented differently.

But as the cygwin port is not really usable right now, this may not
matter.

cu,

Andreas

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de - A.C.Lange@GMX.net

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Andreas

Andreas Lange wrote:

This will IMHO render the cygwin "port" almost useless, as there is no
tcltkgrass until now. There is a wish (could not test this right now),
but it does not work with the tcltkgrass code. I tried to start
tcltkgrass within the cygwin grass shell, but i got only an error
window from wish stating that something is wrong. I remember that all
x11-specific calls will not work with the windows wish, as the
geometry things are implemented differently.

I assume that the behaviour is the same as before if you use "grass5
-text"? If not, then could you please indicate what the new behaviour
is? I didn't change how tcltkgrass works from the command line so it
should be the same if you start with the old text interface.

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@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@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Justin,

i can not test this right now.
But i think that the grass5 -text will work. But it will further confuse
users if they just issue grass5 and they get windows with no useful
information popping up.
We must change all the documentation, so that i think that it will be
simpler to keep the default as it is. In my eyes grass5 -tclwhatever for
the new and grass5 (=grass5 -text) for the old behaviour will be simpler
to recognize/learn.

On my linux installation i get the same error message that Eric
describes. See attached error.txt.
Sorry, i am in a hurry now.

cu,

Andreas

Justin Hickey wrote:

I assume that the behaviour is the same as before if you use "grass5
-text"? If not, then could you please indicate what the new behaviour
is? I didn't change how tcltkgrass works from the command line so it
should be the same if you start with the old text interface.

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de - A.C.Lange@GMX.net

(attachments)

error.txt (272 Bytes)

[cc to grass5]

On Tue, Nov 28, 2000 at 04:19:31PM +0700, Justin Hickey wrote:

> On Tue, Nov 28, 2000 at 04:02:02PM +0700, Justin Hickey wrote:
> > Markus Neteler wrote:
> > > Note: Those being using the new configure.in may mv the new startup
> > > from $GISBASE/bin to /usr/[local/]bin.
> >
> > I don't understand, it is put in ($UNIX_BIN)/grass$(NAME_VER) not
> > $GISBASE/bin ???
>
> Yes, it is put into $GISBASE/bin. But as this directory is not in
> PATH, the user cannot start GRASS :slight_smile:
> The start script has to geo into /usr/bin or /usr/local/bin to
> be found. The hacked configure sets UNIX_BIN to /usr/local/bin,
> the new configure sets UNIX_BIN to /usr/local/grass5/bin
>
> Do you see the problem? Users don't want to start
> /usr/local/grass5/bin/grass5
> but simply
> grass5
> :slight_smile:

If the problem is that $(UNIX_BIN) is being defined as the same as
$GISBASE, then the problem is in configure, not the Gmakefile. If we
can't get a reasonable default for bindir in configure (either
/usr/local/bin - what it should be or /usr/bin - I disagree with this
but if that's the only way ok) then we will have to tell users to use
the --with-bindir option to configure.

Hi Justin,
I don't fully get what you dislike, is it that I prefer "grass5" to be
stored outside of $GISBASE?

From the Linux view I would prefer this way:

The average linux user who has a compile should be able to run:

configure # without annoying extra parameters
make install
grass5

This startup script should go somewhere here:
echo $PATH
/home/neteler/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games/bin:/usr/games:/opt/gnome/bin:/opt/kde/bin:/usr/openwin/bin:.

If you would have to copy it manually from $GISBASE/bin to /usr/[local/]bin,
that's extra work... Perhaps you think the same?!

Yours

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

From: Andreas Lange <Andreas.Lange@Rhein-Main.de>

Hi Justin,

i can not test this right now.
But i think that the grass5 -text will work. But it will further confuse
users if they just issue grass5 and they get windows with no useful
information popping up.
We must change all the documentation, so that i think that it will be
simpler to keep the default as it is. In my eyes grass5 -tclwhatever for
the new and grass5 (=grass5 -text) for the old behaviour will be simpler
to recognize/learn.

On my linux installation i get the same error message that Eric
describes. See attached error.txt.
Sorry, i am in a hurry now.

cu,

Andreas

Justin Hickey wrote:
> I assume that the behaviour is the same as before if you use "grass5
> -text"? If not, then could you please indicate what the new behaviour
> is? I didn't change how tcltkgrass works from the command line so it
> should be the same if you start with the old text interface.
>

I fully agree to this. I personally dislike GUI system, it's too hard to use.
moving mouse, focusing pointer, clicking...
Anyway, to be consistent it would be better to start with text mode w/o flag.

Justin, you told me that a noninteractive startup, which i've added, should
be consistent. I think it's the same problem.

Yours,
Huidae Cho

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Tue, Nov 28, 2000 at 11:57:51PM +0900, GRASS wrote:

From: Andreas Lange <Andreas.Lange@Rhein-Main.de>
>
> Hi Justin,
>
> i can not test this right now.
> But i think that the grass5 -text will work. But it will further confuse
> users if they just issue grass5 and they get windows with no useful
> information popping up.
> We must change all the documentation, so that i think that it will be
> simpler to keep the default as it is. In my eyes grass5 -tclwhatever for
> the new and grass5 (=grass5 -text) for the old behaviour will be simpler
> to recognize/learn.
>
> On my linux installation i get the same error message that Eric
> describes. See attached error.txt.
> Sorry, i am in a hurry now.
>
> cu,
>
> Andreas
>
> Justin Hickey wrote:
> > I assume that the behaviour is the same as before if you use "grass5
> > -text"? If not, then could you please indicate what the new behaviour
> > is? I didn't change how tcltkgrass works from the command line so it
> > should be the same if you start with the old text interface.
> >
>

I fully agree to this. I personally dislike GUI system, it's too hard to use.
moving mouse, focusing pointer, clicking...
Anyway, to be consistent it would be better to start with text mode w/o flag.

Justin, you told me that a noninteractive startup, which i've added, should
be consistent. I think it's the same problem.

Hi all,

it seems to become a more general discussion. From the *average* user's
view I am sure that gui startup is appreciated. GRASS is looking very oldish
if starting with text window. Even mouse selecting of the locations (I use
several in parallel) is very convenient. But, I don't use GUI within GRASS.
Here I prefer to work command line.

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 :slight_smile:
What about this idea as a compromise (if it's feasible, hi Justin)?

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Tue, Nov 28, 2000 at 02:19:55PM +0100, Andreas Lange wrote:

Hi Justin,

i can not test this right now.
But i think that the grass5 -text will work. But it will further confuse
users if they just issue grass5 and they get windows with no useful
information popping up.

Hi Andreas,

I agree - so a test for wish must be there. If it fails, the init
routine must fall back to text. Then nothing bad could happen.

We must change all the documentation, so that i think that it will be
simpler to keep the default as it is. In my eyes grass5 -tclwhatever for
the new and grass5 (=grass5 -text) for the old behaviour will be simpler
to recognize/learn.

Well, to attract more users, some GUI is required. I am working
command line (nearly) only, but I am teaching students (so I get
impressions about the average user's expectations). See my
other mail as well.
Changing docs: I can't see that this is a big task. The new graphical
login is not that difficult to understand, but the text entry is for
newbies. My experience so far...

On my linux installation i get the same error message that Eric
describes. See attached error.txt.
Error in startup script: couldn't read file "wish8.0": no such file or directory

Can we agree to program "wish" everywhere. Seems to be existing on
SuSe platforms. Others? Then we avoid annoying this version checking.

Regards

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

From neteler@geog.uni-hannover.de Wed Nov 29 02:00:42 2000
On Tue, Nov 28, 2000 at 11:57:51PM +0900, GRASS wrote:
> From: Andreas Lange <Andreas.Lange@Rhein-Main.de>
> >
> > Hi Justin,
> >
> > i can not test this right now.
> > But i think that the grass5 -text will work. But it will further confuse
> > users if they just issue grass5 and they get windows with no useful
> > information popping up.
> > We must change all the documentation, so that i think that it will be
> > simpler to keep the default as it is. In my eyes grass5 -tclwhatever for
> > the new and grass5 (=grass5 -text) for the old behaviour will be simpler
> > to recognize/learn.
> >
> > On my linux installation i get the same error message that Eric
> > describes. See attached error.txt.
> > Sorry, i am in a hurry now.
> >
> > cu,
> >
> > Andreas
> >
> > Justin Hickey wrote:
> > > I assume that the behaviour is the same as before if you use "grass5
> > > -text"? If not, then could you please indicate what the new behaviour
> > > is? I didn't change how tcltkgrass works from the command line so it
> > > should be the same if you start with the old text interface.
> > >
> >
>
> I fully agree to this. I personally dislike GUI system, it's too hard to use.
> moving mouse, focusing pointer, clicking...
> Anyway, to be consistent it would be better to start with text mode w/o flag.
>
> Justin, you told me that a noninteractive startup, which i've added, should
> be consistent. I think it's the same problem.

Hi all,

it seems to become a more general discussion. From the *average* user's
view I am sure that gui startup is appreciated. GRASS is looking very oldish
if starting with text window. Even mouse selecting of the locations (I use
several in parallel) is very convenient. But, I don't use GUI within GRASS.
Here I prefer to work command line.

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 :slight_smile:
What about this idea as a compromise (if it's feasible, hi Justin)?

Markus

Happy proposal :slight_smile:

Huidae Cho

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi again,

it was not my intention to start a GUI/commandline flame war.

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 :slight_smile:
> What about this idea as a compromise (if it's feasible, hi Justin)?
>
> Markus
>

Happy proposal :slight_smile:

Huidae Cho

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de - A.C.Lange@GMX.net

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

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 :slight_smile:
> > What about this idea as a compromise (if it's feasible, hi
> > Justin)?
> >
> > Markus
> >
>
> Happy proposal :slight_smile:
>
> Huidae Cho

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@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@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Markus

Markus Neteler wrote:

> If the problem is that $(UNIX_BIN) is being defined as the same as
> $GISBASE, then the problem is in configure, not the Gmakefile. If we
> can't get a reasonable default for bindir in configure (either
> /usr/local/bin - what it should be or /usr/bin - I disagree with
> this but if that's the only way ok) then we will have to tell users
> to use the --with-bindir option to configure.

Hi Justin,
I don't fully get what you dislike, is it that I prefer "grass5" to
be stored outside of $GISBASE?

From the Linux view I would prefer this way:
The average linux user who has a compile should be able to run:

configure # without annoying extra parameters
make install
grass5

This startup script should go somewhere here:
echo $PATH
/home/neteler/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games/bin:/usr/games:/opt/gnome/bin:/opt/kde/bin:/usr/openwin/bin:.

If you would have to copy it manually from $GISBASE/bin to
/usr/[local/]bin,
that's extra work... Perhaps you think the same?!

Yes we are thinking the same, I agree that grass5 should be in the path.
Perhaps the confusion is on my part. I was under the impression that you
thought that since grass5 is put into $GISBASE/bin by default that it
was a problem with the initialization script placing the grass5 script
in that directory. I'm sorry if this was the case. It is actually a
configure problem because in configure, the bindir was not defined
properly and was defaulting to /usr/local/grass5/bin thus the
$(UNIX_BIN) variable in the src/general/init/Gmakefile becomes
/usr/local/grass5/bin. My fix I found yesterday, (and will be committed
soon) solves this problem.

My disagreement with /usr/bin comes from system administration. Software
(or executables) should not be installed under /usr/bin since it
contains vendor supplied programs. The only changes I make under
/usr/bin is to create links to executables that replace programs in
/usr/bin. For example, I install the latest Tcl/Tk under /usr/local. I
need to create a link /usr/bin/wish so that scripts that begin with

#!/usr/bin/wish

will use the new wish command. Anyway, all non-vendor installed software
should go under /usr/local/bin not /usr/bin. At least that was what I
was taught about system administration.

Are we still not understanding each other? :slight_smile:

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@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@geog.uni-hannover.de with
subject 'unsubscribe grass5'

One thing you should consider too, is checking if the $DISPLAY
environment variable is set. Could be a user is running in a console
only mode (console, telnet, ssh with no X forwarding). Haven't a clue
about Windows in this regard.

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Eric

"Eric G . Miller" wrote:

One thing you should consider too, is checking if the $DISPLAY
environment variable is set. Could be a user is running in a console
only mode (console, telnet, ssh with no X forwarding). Haven't a clue
about Windows in this regard.

Oooh! Good catch, I never thought of that one. I'll look into it. Does
this problem even apply on Windows?

Thanks.

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@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@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi all friend of GRASS with and without GUI :slight_smile:

On Wed, Nov 29, 2000 at 10:46:11AM +0700, Justin Hickey wrote:

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.

Well, here I have been causing the confusion. I wasn't aware that "wish"
is a standard link. As wish4.2 has been disappearing the last month,
we will be able to *savely* use "wish" on startup.
Justin, I will remove this wish-search-script stuff now and directly
implement the code-fragment of Andreas.

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.

Sounds good.

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.

Sounds good as well. We need wish >= 8.0

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.

Yes, like that it should be possible to add platform sensivity.

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.

Maybe it would be more simple to store the preference in .grassrc5 instead
of modifying so many .<shell>rc's. Storing in a file strongly related to
GRASS might be more save against user modifications (if they change their
.<shell>rc manually or whatever).

That's just my 2 cents worth.

Mine too...

Markus

Andreas Lange wrote:

[...]

> 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.

I agree.

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Justin, Hi Eric,

the $DISPLAY is IMHO the best solution to the discussed problem.
Check if $DISPLAY is set and you know for sure that X is running.
If you next search for the wish executable in the user path i think that
in most of the cases this should work and we can start with the GUI
first. Otherwise a fallback to text mode would be ok.
This applies to the windows setup too, as the DISPLAY variable is set
only if X is running (The X server seems still to be a little unstable).
I'll check for the name of wish/tk shell in cygwin later.

Thanks Eric for this idea.
I agree that it is desirable to start up with a nice GUI. Most software,
even if using commands typed in a window, uses a GUI today.

Andreas

Justin Hickey wrote:

Hi Eric

"Eric G . Miller" wrote:
> One thing you should consider too, is checking if the $DISPLAY
> environment variable is set. Could be a user is running in a console
> only mode (console, telnet, ssh with no X forwarding). Haven't a clue
> about Windows in this regard.

Oooh! Good catch, I never thought of that one. I'll look into it. Does
this problem even apply on Windows?

Thanks.

--
Sincerely,

Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@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@geog.uni-hannover.de with
subject 'unsubscribe grass5'

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de - A.C.Lange@GMX.net

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Andreas Lange wrote:

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.

I just had an idea:

On Unix systems, "ln -s `which wish` $GISBASE/bin/grasswish".
Any desired wish could be used, configure could take a
--with-wish=/path/to/mywish argument for configurability,
or check for "wish, wish8.0, etc." for known working versions.

On WinXX systems, The tcl-restart hack doesn't work anyway,
and you have to either type "wish /path/to/tcltkgrass", or
even better, create a tcltkgrass.bat file that does the same
thing, i.e. "wish /path/to/tcltkgrass %1 %2 %3 %4 ... %9".

This way, the user can update their wish, and grass doesn't
necessarily rely on a particular version of wish, just a link
from (or copy in) $GISBASE/bin/grasswish to the "real" wish.

-- ebm
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
| Eric B. Mitchell mailto:emitchell@altaira.com |
| tel: (301) 809 - 3534 Altair Aerospace Corporation |
| tel: (800) 7 - ALTAIR 4201 Northview Dr. Suite 410 |
| fax: (301) 805 - 8122 Bowie, MD 20716 |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
              ,___
          /"\ / o=\ /"""---===/
         / \_/ \__/ ---===/
         | //\ || /""TT""/ //\ || ||""\
         | // \ || || // \ || ||__/
         | //--==\ |L--/ || //--==\ || || "=,
          \ ---===/
           \____---===/

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'