Re: RIET USERS: Multiple OS GUI C++ Tools

Brian H. Toby ( (no email) )
Mon, 23 Feb 1998 12:37:50 -0500

Folks,

I have a few comments on the issues Lachlan, Alan & Bob have raised in
mid-February. I am a great proponent of Tcl/Tk. We use it for stuff ranging
from data processing to experiment scheduling here at the NIST reactor. For
people who have never heard of Tcl/Tk, Tcl is is a scripting language that is
pretty much platform independent and free (http://sunscript.sun.com/).

Tk is a graphical interface add-on that does a nice job of creating GUIs. It
runs in UNIX, on Macs and in Windows. Not everything works as well in Win-95 as
on other platforms, but what does? A graphical interface for GUI design can
also be used with Tcl/Tk: there are at least three free "Visual-Basic type" GUI
builders out there. The older one, SpecTcl is available on the Sun server.
Another, Visual Tcl, (http://www.neuron.com/stewart/vtcl/) I have not used but
I have heard is pretty good. A third that is under development is described in
http://www.virtualbase.com/vtcl.html.

For scientific graphics, I tend to use the BLT Tcl/Tk package, but I prefer the
graphics from PGPLOT. PGPLOT can also be used to do graphics inside a Tk
widget. Tim Pearson @ Caltech distributes a X-Windows-only driver for Tcl/Tk. I
wrote a more portable driver (see PGTK on http://rrdjazz.nist.gov/~toby/) for
use with UNIX and Windows, but it works on some Win-95 systems and not others.
I am looking for someone to figure this puzzle out (I suspect the MS FORTRAN
compiler). I don't use Windows very often anymore.

I am slowly moving capabilities from some of my VAX-only or SGI-only programs
into this format. A good example is shown in
http://rrdjazz.nist.gov/~toby/cmpr.html. The GSAS GUI that Bob mentioned (see
http://rrdjazz.nist.gov/~toby/gsasgui.html) took about 700 lines of code and is
user-configurable (see http://rrdjazz.nist.gov/~toby/gsasgui_cfg.html).

It is possible to extend Tcl/Tk with your own C or even FORTRAN code. I don't
have a web page on this, but I needed to do this for the UNIX/Windows version
of my LOGIC program for accessing the ICDD/JCPDS database. Some slides on that
can be found in ftp://rrdjazz.nist.gov/bt1/powdersuite/slides.ps.gz and the
code is in ftp://rrdjazz.nist.gov/bt1/powdersuite/powder_suite.tar.gz. There is
also a Web interface, but this is far more limited than the GUI version.

I have mixed feelings on object-oriented programming. If someone took the time
to design a good crystallography class library that includes support for
magnetic scattering, CW & TOF neutron, rigid bodies, single crystal, strain
tensors,... then a Rietveld code would be pretty easy to create. I think that
such a class library would take years to make. Further, the first few tries
would be discarded. Personally, I can use class libraries but their design is
beyond me.

Alan's description of considering individual FORTRAN programs as objects can
work well. The goal is to write short programs that do simple tasks and then to
use a wrapper (such as Tcl/Tk or a Web form+cgi script) to create a user
interface. This does not work for all tasks, particularly tasks where you
generate large amounts of intermediate results that need to be saved and
reloaded in order to continue. The JCPDS/ICDD program is a good example. One
searches the database, looks at the hits and then you want to apply different
search criteria to the hits you have found. While it is possible to do this
with lots of short programs, it works much better when the code is integrated
into a single program. Alan is definitely correct that programs with extensive
question-and-answer dialogs are to be avoided. I have some ideas for a GUI
alternative to expedt, but when one considers all the different functions that
expedt does, it becomes clear how large a project it is.

Brian

-- ********************************************************************Brian H. Toby, Ph.D.                    Leader, Crystallography TeamBrian.Toby@NIST.gov        NIST Center for Neutron Research E151/235voice: 301-975-4297     National Institute of Standards & TechnologyFAX: 301-921-9847                             Gaithersburg, MD 20899********************************************************************