[GRASS5] Mac OS X Patches and Additions

Greetings,

I have attached a (small) tar file with patches and applications for GRASS 5.4.0 and 5.7.0 which on Mac OS X provide the following features:

* Enables compatibility with the Aqua version of TCL/TK
* Enables native Mac OS X preferred browser support for online help
* Support for special Mac OS X characters such as spaces with tcltkgrass
* Brings the TCL/TK GUI automatically to the front

These patches are designed to be applied to the source code. I will provide patches with the 5.4.0 and 5.7.0 binaries that I am uploading (I have uploaded the 5.4.0 binaries, and I am going to upload 5.7.0 when I get NVIZ working from the GUI).

The following scripts and programs included in the archive should be installed to /usr/bin or /usr/local/bin:
• lsWrap: Wrapper for "ls"; support for Mac OS X special characters
• appToFront: application to bring an app to support (source code available upon request)
• wishToFront: wrapper for "appToFront"; brings Wish application to the foreground

If anyone has any questions, please let em know.

(attachments)

grass-openosx-additions.tar.gz (25.1 KB)

Thanks Jeshua for your efforts for Mac.

However, we need to make sure this works well with the distribution that
Lorenzo Moretti has developed for Mac OSX. One big issue is that Lorenzo's
version of GRASS is now installed into the /Applications folder. This is the
standard location for applications under OSX rather than the Unix/Linux
standard of /usr/local/. While one can debate the merits or disadvantages of
this from a standardization perspective, it is where most Mac users look for
applications and overcomes the annoying reality that Apple chose to hide the
/usr directory from normal Mac users, while the /Applications directory is
accessible without dropping into the terminal or specifying a special path
to the Mac GUI.

Using Aqua would be desirable if it were difficult to get and xwindows
version of tcltk installed (This was the case about a year ago). However,
Lorenzo has developed nice *.dmg versions of needed GRASS libraries,
including x11 standard tcltk. If this is not moving all of GRASS to Aqua and
out of x11, I'm not sure what is gained now by patching it for a
non-standard tcltk. Perhaps Glynn or others could speak to this.

Mac preferred browser support already works for GRASS 5.7, but it would
certainly be nice to have this for 5.4 too. This may just need a bit of
tweaking to tcltkgrass for 5.4 or it might need something more complex.

Support for spaces and other non alphanumeric characters is also nice, but I
think that there is no longer a problem with this in either 5.4 or 5.7.

Finally, I'm not sure what is meant by automatically bringing the GUI to the
front. Currently, I can bring it to the front like any other application by
clicking on it with a mouse, or hide it as needed. Perhaps I misunderstand.

Perhaps Lorenzo, Kirk, or other GRASS Mac users will be able to offer
additional clarifications. I am not trying to be negative and welcome anyone
who can help make GRASS more useable on the Mac or any platform. There are
indeed places where Mac support for GRASS can be improved. But I'm not sure
that the 4 items listed here are ones that need to be fixed (preferred
browser support for 5.4 being the primary exception to this). I guess I
would be cautious about altering the source code for these items without
more information.

Michael Barton

On 11/8/04 12:16 AM, "Jeshua Lacock" <jeshua@OpenOSX.com> wrote:

Greetings,

I have attached a (small) tar file with patches and applications for
GRASS 5.4.0 and 5.7.0 which on Mac OS X provide the following features:

* Enables compatibility with the Aqua version of TCL/TK
* Enables native Mac OS X preferred browser support for online help
* Support for special Mac OS X characters such as spaces with tcltkgrass
* Brings the TCL/TK GUI automatically to the front

These patches are designed to be applied to the source code. I will
provide patches with the 5.4.0 and 5.7.0 binaries that I am uploading
(I have uploaded the 5.4.0 binaries, and I am going to upload 5.7.0
when I get NVIZ working from the GUI).

The following scripts and programs included in the archive should be
installed to /usr/bin or /usr/local/bin:
€ lsWrap: Wrapper for "ls"; support for Mac OS X special characters
€ appToFront: application to bring an app to support (source code
available upon request)
€ wishToFront: wrapper for "appToFront"; brings Wish application to the
foreground

If anyone has any questions, please let em know.

Cheers,

Jeshua Lacock __________________________
Programmer/Owner Phone: 877.240.1364
http://OpenOSX.com Fax: 415.462.6211
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

______________________________
Michael Barton, Professor of Anthropology
School of Human, Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

On Nov 8, 2004, at 11:47 AM, Michael Barton wrote:

Thanks Jeshua for your efforts for Mac.

Thank you Michael.

However, we need to make sure this works well with the distribution that
Lorenzo Moretti has developed for Mac OSX. One big issue is that Lorenzo's
version of GRASS is now installed into the /Applications folder. This is the
standard location for applications under OSX rather than the Unix/Linux
standard of /usr/local/. While one can debate the merits or disadvantages of
this from a standardization perspective, it is where most Mac users look for
applications and overcomes the annoying reality that Apple chose to hide the
/usr directory from normal Mac users, while the /Applications directory is
accessible without dropping into the terminal or specifying a special path
to the Mac GUI.

IMHO I think that it is best _not_ to put GRASS in the Applications folder, as GRASS really requires a terminal, and I think it is in the users best interest to start and use GRASS from a terminal. I think it is valuable for the user to know how to do this.

Remember GRASS is not exactly Microsoft Word.

Using Aqua would be desirable if it were difficult to get and xwindows
version of tcltk installed (This was the case about a year ago). However,
Lorenzo has developed nice *.dmg versions of needed GRASS libraries,
including x11 standard tcltk. If this is not moving all of GRASS to Aqua and
out of x11, I'm not sure what is gained now by patching it for a
non-standard tcltk. Perhaps Glynn or others could speak to this.

I really can not disagree with you more. The average Mac user would pick the Aqua version over the Unix version, _anyday_; I am sure,

With Apple's version of X11 and the Aqua version of TCL/TK, it offers much more of a true "Mac Experience". You would hardly ever know you where in a X11/Wish environment instead of a fully native Mac OS X Cocoa application.

For example, the choose file dialog is a native Mac OS X cocoa "Choose File" dialog, which offers the user far more connivence and familiarity than the Wish/X11 choose dialog box. The Mac version allows you to sort by date, drag files and folders to select them, has all of the users shortcuts and recently used files. This reason alone is more than enough to justify WHY one would prefer to use the Aqua version of TCL/TK.

Of course, suite your self. My customers demand more.

Mac preferred browser support already works for GRASS 5.7, but it would
certainly be nice to have this for 5.4 too.

Hmm - that is odd, because it seems that I still had to patch the same file the same way that I did with Grass 5.0-5.4.

This may just need a bit of
tweaking to tcltkgrass for 5.4 or it might need something more complex.

Its done. It works. It is simple. Look at the patches. It's worked since Grass 5.0. I also explained it on this list when I first submitted the patch. See "[GRASS5] More Mac OS X Tcltkgrass Tweaks", April 27, 2003, from me.

Though rather than using "launchURL", I now just call "open".

Support for spaces and other non alphanumeric characters is also nice, but I
think that there is no longer a problem with this in either 5.4 or 5.7.

Hmm, again that is weird, because I had to patch the same bits of the tcltk interface as I did with Grass 5.0.

Finally, I'm not sure what is meant by automatically bringing the GUI to the
front. Currently, I can bring it to the front like any other application by
clicking on it with a mouse, or hide it as needed. Perhaps I misunderstand.

When you execute "tcltkgrass &", the GUI starts, but you have to click on the "Wish" icon to bring it to the foreground so that you may use it. Our solution brings it to the front, like you might expect it to.

Perhaps Lorenzo, Kirk, or other GRASS Mac users will be able to offer
additional clarifications. I am not trying to be negative and welcome anyone
who can help make GRASS more useable on the Mac or any platform. There are
indeed places where Mac support for GRASS can be improved. But I'm not sure
that the 4 items listed here are ones that need to be fixed (preferred
browser support for 5.4 being the primary exception to this). I guess I
would be cautious about altering the source code for these items without
more information.

They have been fixed. They work. They have been tested. They have worked since Grass 5.0. I have provided more information in the past. Look at the patches. They are extremely simple. Its not rocket science or anything.

My users and myself appreciate the changes.

We will continue to use them, I am just contributing what we develop and will continue to do so.

You may not know me, but I was the first person to get GRASS working on Mac OS X Public Beta, and I have professionally lived and breathed Mac OS X since then.

Sincerely,

Jeshua Lacock __________________________
Programmer/Owner Phone: 877.240.1364
http://OpenOSX.com Fax: 415.462.6211
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

> Mac preferred browser support already works for GRASS 5.7, but it
> would certainly be nice to have this for 5.4 too.

Hmm - that is odd, because it seems that I still had to patch the same
file the same way that I did with Grass 5.0-5.4.

It's fixed since a year. see $GRASS_HTML_BROWSER in ~ line 214:
http://freegis.org/cgi-bin/viewcvs.cgi/grass51/lib/init/init.sh

> Support for spaces and other non alphanumeric characters is also
> nice, but I think that there is no longer a problem with this in
> either 5.4 or 5.7.

Hmm, again that is weird, because I had to patch the same bits of the
tcltk interface as I did with Grass 5.0.

This was fixed in CVS after 5.7.0 was released:
http://grass.itc.it/pipermail/grass-commit/2004-August/012254.html

> Finally, I'm not sure what is meant by automatically bringing the
> GUI to the front.

..

When you execute "tcltkgrass &", the GUI starts, but you have to click
on the "Wish" icon to bring it to the foreground so that you may use
it. Our solution brings it to the front, like you might expect it to.

Again after 5.7.0 was released things changed. Everything happens in the
d.m menu now, so while the default click-to-focus window manager mode
(which can be changed!) is still a pain in the neck, there are now fewer
windows to go back and forth between so it isn't as bad as it was...

> Perhaps Lorenzo, Kirk, or other GRASS Mac users will be able to
> offer additional clarifications.

..

They have been fixed. They work. They have been tested. They have
worked since Grass 5.0.

The quality and usefulness of the code isn't as issue. The issue is
which improvements are platform-agnostic enough to be included in CVS,
making less patching work for you and a better overall product for
everybody.

Compound all this with 5.7.0 being a snapshot of a 6 month old live
branch and we have minor confusion...

Hamish

Jeshua Lacock wrote:

I have attached a (small) tar file with patches and applications for
GRASS 5.4.0 and 5.7.0 which on Mac OS X provide the following features:

* Enables compatibility with the Aqua version of TCL/TK
* Enables native Mac OS X preferred browser support for online help
* Support for special Mac OS X characters such as spaces with tcltkgrass
* Brings the TCL/TK GUI automatically to the front

These patches are designed to be applied to the source code. I will
provide patches with the 5.4.0 and 5.7.0 binaries that I am uploading
(I have uploaded the 5.4.0 binaries, and I am going to upload 5.7.0
when I get NVIZ working from the GUI).

The following scripts and programs included in the archive should be
installed to /usr/bin or /usr/local/bin:
• lsWrap: Wrapper for "ls"; support for Mac OS X special characters
• appToFront: application to bring an app to support (source code
available upon request)
• wishToFront: wrapper for "appToFront"; brings Wish application to the
foreground

If anyone has any questions, please let em know.

I've only looked at the patches briefly. However, as they stand, they
would appear to break other platforms. We need to find solutions such
that a single source tree can be used for any platform.

Some specifics:

I'm not sure that we should be explicitly adding /usr/X11R6/bin to
$PATH in init.sh. This should go into the user's ~/.grass.cshrc if
they don't already have /usr/X11R6/bin in their path.

The use of "[exec ls -a [exec pwd]]" in gis_set.tcl should be replaced
by the use of Tcl's "glob" function, e.g.

  foreach i [glob "*"] {

Or, if dotfiles are really required (they probably aren't):

  foreach i [concat [glob "*"] [glob ".*"]] {

The wishToFront script needs to be installed and run from somewhere
under $GISBASE. It also needs to be arranged such that it doesn't
complain on other platforms.

Also, the 5.7.0 tcltkgrass changes are probably obsolete, as
tcltkgrass has been completely re-written. Most of the functionality
is now provided by libgis. The dialogs which appear in tcltkgrass are
the same ones which you get if you run the command without arguments
or with the --ui switch; tcltkgrass itself is little more than a menu.

--
Glynn Clements <glynn@gclements.plus.com>