TCL/TK and GRASS

How many people out there are using xgrass as compared with normal
command line grass?
All:

I wanted to use xgrass very much, but I didnt want to buy Motif. It
prevents grass from being a truly free public domain package.

What moves are there to develop a tcl/tk interface?

I ask because if no one wants to do it, then I will start to investigate
the tcl/tk package, with a view to writing one.

What do others feel about this? I haven't heard much since Dave Gerdes
posting a few weeks ago about the tcl/tk workshop.

I won't be able to write it until about May/June, when my current commitments
will change, but what do others think? I don't want to re-invent any wheels.

Jeremy Stocks,
Bangor University,
Wales, UK.

On Thu, 3 Mar 1994, Mr J D Stocks wrote:

How many people out there are using xgrass as compared with normal
command line grass?

I'm pretty effectively boycotting XGRASS, since Motif would be the first
and only proprietary software in my whole (Linux-based) installation. I'm
very interested in a non-proprietary GUI for GRASS, though.

I wanted to use xgrass very much, but I didnt want to buy Motif. It
prevents grass from being a truly free public domain package.

Ah. Great minds think alike.

What moves are there to develop a tcl/tk interface?

I ask because if no one wants to do it, then I will start to investigate
the tcl/tk package, with a view to writing one.

I have started investigating Tcl/Tk and one other public-domain, X-based GUI
development environment, with a view to developing part of a GRASS GUI.
This looks like we have a clear need for teamwork. Fine by me.

What do others feel about this? I haven't heard much since Dave Gerdes
posting a few weeks ago about the tcl/tk workshop.

I won't be able to write it until about May/June, when my current
commitments will change, but what do others think? I don't want to
re-invent any wheels.

Most importantly, I think we need to ascertain what kinds of GUI
styles/paradigms are in greatest demand. Personally, I favor the
drag-and-drop/popup-menu object-oriented style, which would lend itself to
a lot of GRASS. Others might favor a more straightforward orientation
around the GRASS command-line interface. Then there is the functional
dataflow style as found in Khoros and AVS, which would be the most elegant
means of encapsulating the current philosophy of GRASS in a GUI, perhaps,
but also the most work to develop.

I'd be more than happy to talk about teaming up with one or more people
interested in collaborating on a truly public-domain GRASS GUI, based on
whatever PD development platform the team were to decide upon. I'm
inclined to favor Tcl/Tk over anything else I've seen so far, but I'll
know more in a couple of weeks.

I recall that Nancy Taaffe posted that GRASS 4.2 is supposed to include a
(new?) object-oriented GUI. Anybody know more about that? Nancy?

-- Mark

--------------------------------------------------------------------
Mark P. Line Phone: +1-206-733-6040
Open Pathways Fax: +1-206-733-6040
P.O. Box F Email: markline@henson.cc.wwu.edu
Bellingham, WA 98227-0296
--------------------------------------------------------------------

Hello !

We have tested tcl/tk with grass and we have noticed it very powerful
toolkit. There is also an extension of tcl/tk called expect/expectk
with it you can create GUIs for interactive programs also.
we have tested it with v.digit and it seems to run well with it.
Unfortunately the job has been only testing and nothing ready isn't available
(yet ???).

Expect allows you to manipulate several programs at the same time and
it is fully combatilbe witk tcl/tk scripts.

I don't remember where to find it, but ask archie

Janne Soimasuo Faculty of Forestry.
jsoi@cc.joensuu.fi

In mailgate.grass.user you write:

What moves are there to develop a tcl/tk interface?

I was also interested in developing a tcl/tk interface to
Grass, but didn't have the time or talent to do the work.
Fortunately,about the same time as I was scoping out the
problem I met up with Gilles Clement of LIS Inc (Montreal).
Gilles and his company had already developed an enhanced
Grass display driver, and were interested in using to
build decision support system types of applications.
A couple of months ago I let a contract to Gilles to turn
his display driver into a tcl/tk widget, and to write a bit
of sample tcl code to show how to use it.

Last week I got my first peek at the results, and it is
truly fantastic! The display widget (called 'view') interfaces
seamlessly into the tcl/tk environment as does any other widget.
I haven't had a chance to do much with it, but here is what I
know of it. You can create one view, or as many views as you want,
in any place in the tk widget tree. A view can take up a whole top
level window, or it can be part of a window along with buttons,
scroll bars, input fields, bar charts, lists, etc. Views accept
messages that tell them how to behave. You tell the view what
images to display, how they should be overlayed, and what region should
should be shown. Once image(s) are displayed in a view, you can
issue messages to zoom and pan. Since this is tcl/tk, these
messages can be bound to buttons or scroll bars. Using tk, you can
build as fancy a display device as you like. Place your own icons,
display a field showing scale factors, coordinators, legend classes,
make a special field in any font/color to show the title, etc. The
possibilities are endless. Depending on how you want your application to
behave, you can set up a tcl script to have multiple views zoom and pan
independently or synchronously.

A few other aspects of the display widget:
The display widget avoids the named pipe issue that apparently
slows down the standard disply system. All actions are
asynchrounous and interuptable. So for example, if you click
on the zoom in button, and then click again in quick succession,
the widget will stop drawing the first level of zoom, and immediately
begin drawing the second level. I saw this in action, and it is a
pretty neat feature. The view widget also takes correct action to
update itself when it has been resized, so if you grab a resize corner
with the mouse and make the window bigger, the set of images in the
view will repaint as you expect (want). This works in concert with
the tk pack/place geometry managers (geometry managers are one of the
more appealing features of tcl/tk. Forgive me for not going into
details about them here, but don't think I could do it justice.)

So much for the display widget.

Gilles was also going to put together a couple of sample tcl
scripts to show how to interface tcl/tk with the standard
grass command lines. Well, he thought about it, and decided
to put together something even better. Gilles is developing a
translator that reads in the XGRASS definition files, and automatically
on-the-fly builds tcl/tk control panels. When completed, this
will mean that all of the XGRASS menus will be available and
can be called up from within tcl/tk. There are some really powerful
implications here. Since tcl is an interpreted language, and
the tk widgets are objects that can be interogated and manipulated,
it is easy to extend/modify/customize these menus during run-time.

Sorry for raving on about this stuff like a fanatic. I know
this sounds like a lot of hype, but I am really impressed with
what Gilles and crew were able to put togeher for us. If you
want to know more about this Gilles will be presenting a couple
of papers at the Grass User conference next week. I think he
is planning to have the software on hand to give a demonstration.
I will check to see if he is going to have a written paper. If
so I'll get a copy and put it on our ftp server for everyone.

Right now this softare is in an alpha-test status. As soon
as I have had a chance to test it out and it seems stable we
will be contributing it (to cecer.army.mil?). This will definitely
have to wait until after Gilles gets back from the conference.

I'll post more details as I get them.

Tom
--
Tom Moore tmoore@pnfi.forestry.ca
Petawawa National Forestry Institute
Canadian Forest Service, Box 2000, Chalk River +1 (613) 589-3048
ONT K0J 1J0 CANADA +1 (613) 589-2275 telefax