[comp.windows.x] simple x interface tools from shell scripts?

max@spam.uchicago.edu (07/25/90)

I am looking for x user interface development tools which can be called from 
shell scripts.  By this I mean programs like xmessage, yorn, etc. which can be
called from a shell script to x-ify simple prompting tasks and such like.  

For example, I'd like something for simple menus, where I provide a list of 
menu item names (say, as a here document in a shell script), it brings up a
menu in an x-window, and tells me which item was selected.  Does anyone know of
such a thing?

More fancy, how about an x version of sf (written by Paul Lew)?  sf provides a
dumb-terminal based form editing interface to shell scripts.  As input, one
provides a simple form layout with indications of the types of the data to be
input in the blanks.  It draws a form on the terminal, provides simple editing,
and returns the results as a shell script which sets shell variables to the
input values.  Has anyone made something like this?

Thanks for any help,

Donald Ziff (Max)         Center for Information and Language Studies
                          1100 E. 57th Street, Chicago, Illinois   60637
                          max@estragon.UChicago.{EDU,BITNET,MAILNET,CSNET}
                          ...!uunet!mimsy!oddjob!gargoyle!max

rlh2@ukc.ac.uk (Richard Hesketh) (07/25/90)

In article <1990Jul24.194548.22897@midway.uchicago.edu> max@spam.uchicago.edu () writes:
>I am looking for x user interface development tools which can be called from 
>shell scripts.  By this I mean programs like xmessage, yorn, etc. which can be
>called from a shell script to x-ify simple prompting tasks and such like.  

This is becoming more popular .. I have a system of on-screen buttons
which contain scripts (sh, csh, bash, ksh, perl .. etc) which are executed
when the button is pressed.  These buttons provide a neat environment to
store useful scripts and they allow prototyping of new scripts.

I therefore came upon the same need for useful tools.  I haven't heard of
"yorn" (where can I get it?) but I use xmessage, a form filling tool,
a menu tool and lots and lots of xterms 8-).

>For example, I'd like something for simple menus, where I provide a list of 
>menu item names (say, as a here document in a shell script), it brings up a
>menu in an x-window, and tells me which item was selected.  Does anyone know of
>such a thing?

Yup, I posted one "xmenu" to comp.sources.x over a month ago.  If you
can't find it in an archive (it was posted as "v08i008: xmenu" and is
currently at patchlevel 1) then send me email.

I also posted an even smaller tool that allows scripts to grab and set
selection values.  "xselection" takes a selection property name and a
string value and sets the new selection to this value.  Just calling
xselection with the property name returns the current value (if any) on
the standard output .. this allow you to do things like ..

	xselection PRIMARY | spell

to check its spelling, bung it in a file, send it to a printer ... and so on.

>More fancy, how about an x version of sf (written by Paul Lew)?  sf provides a
>dumb-terminal based form editing interface to shell scripts.  As input, one
>provides a simple form layout with indications of the types of the data to be
>input in the blanks.  It draws a form on the terminal, provides simple editing,
>and returns the results as a shell script which sets shell variables to the
>input values.  Has anyone made something like this?

My collegue Alison Fowler, has written a form fill-in tool that takes a
simple syntax, parses it and displays a form containing different fields for
text entry, one-of-many and many-of-many values.  It outputs the results as
shell variables which can be EVALuated.  Its needs a little change in the
syntax before Alison is willing to release it.

I think the small x-tool approach using scripts as processing "glue" works
very well in practice.  Combining these with buttons that remove the
need to run things in xterms and you can produce quite a good and cheap
user interface to x.

I am writing a paper on this small-tool/script/button approach to graphical
interfaces for UNIX and I would be extremely interested to hear of peoples
experiences of "x-ifying" their UNIX environment.  Plus if you have
other small tools that you have developed or if you have a good idea for
a tool please drop me a line.

Thanks,
	Richard

Richard Hesketh   :   @nsfnet-relay.ac.uk:rlh2@ukc.ac.uk
		  :   rlh2@ukc.ac.uk    ..!mcsun!ukc!rlh2
---                                               
Computing Lab., University of Kent at Canterbury,
Canterbury, Kent, CT2 7NF, United Kingdom.    Tel: +44 227 764000 ext 7620/3682

scarpell@cnca-cam.fr (Claude Scarpelli) (07/25/90)

In article <5177@harrier.ukc.ac.uk> rlh2@ukc.ac.uk (Richard Hesketh) writes:
>In article <1990Jul24.194548.22897@midway.uchicago.edu> max@spam.uchicago.edu () writes:
>>I am looking for x user interface development tools which can be called from 
>>shell scripts.  By this I mean programs like xmessage, yorn, etc. which can be
>>called from a shell script to x-ify simple prompting tasks and such like.  
>

Few month ago a program called xgen was posted in this newsgroup. Here
is a part of the README file associared with it :


Xgen - An X-window based applications generator.  Parses user generated
scripts which define an interactive user environment in X-window using
pop-up menus, messages, and user input fields.  Information collected from
users can be assembled into UNIX commands.

Developed as a Master's project in the Department of Civil Engineering, MIT,
by Antoine Awaida.  Funded by the US Army Corps' Construction Engineering
Research Laboratory, Champaign, Illinois.

OPERATIONAL STATUS:  Developed and running on SUN-3 machines using X11.3.
Not tested on any other platforms.  Prototype.  Will occasionally crash
if user input is in error.  Shareware.  Comments are welcome.  Please
mail to westerve@osiris.cso.uiuc.edu where information will be collected
for possible future upgrades.

DOCUMENTATION:  Internal to this directory see:
  application:   a sample input file to xgen; run via:   xgen application
  xgen.ms:       pass throught tbl(1) and troff(1) -ms

A master's thesis was generated for this project, but it is not available 
in digital form.  It contains similar information to xgen.doc (above)
with the inclusion of short discussions on 1) X, 2) GRASS (a geographical
information system), 3) design philosophy, and 4) implementation of the
application generator concepts.   Probably not very useful to most readers.
For a copy, mail westerve@osiris.cso.uiuc.edu.

[stuff deleted...]

Limitations
 1) Parsing takes place in two phases.  First an initial read of the
	application is made; information is stored away in structures.
	Then, during execution this information is analyzed.   Full analysis
	of the application should take place before execution.
 2) Despite the larger fixed buffers, users will likely encounter
	limitations in the form of overwritten memory and core dumps.
 3) Some logical testing is required as an integral part of applications.

ries@venice.SEDD.TRW.COM (Marc Ries) (07/26/90)

In article <5177@harrier.ukc.ac.uk> rlh2@ukc.ac.uk (Richard Hesketh) writes:
>In article <1990Jul24.194548.22897@midway.uchicago.edu> max@spam.uchicago.edu () writes:
->>I am looking for x user interface development tools which can be called from 
->>shell scripts.  By this I mean programs like xmessage, yorn, etc. which can be
->>called from a shell script to x-ify simple prompting tasks and such like.  
[...]
->Yup, I posted one "xmenu" to comp.sources.x over a month ago.  If you
->can't find it in an archive (it was posted as "v08i008: xmenu" and is
->currently at patchlevel 1) then send me email.

  Does anyone have something like "xmenu" that will run under MOTIF 
  w/o the athena widget set OR the X11R4 intrinsics (e.g., HPUX MOTIF)?

  

mayer@hplabsz.HPL.HP.COM (Niels Mayer) (07/26/90)

From: ries@venice.SEDD.TRW.COM (Marc Ries)
>   Does anyone have something like "xmenu" that will run under MOTIF
>   w/o the athena widget set OR the X11R4 intrinsics (e.g., HPUX MOTIF)?

I use WINTERP to write "shell script" like programs that interface to other
unix commands. With WINTERP can programmatically create/modify any Motif
widget you want. It even contains its own scripting language  that is
far far more powerful than csh, ksh, sh, etc.

Get it via anonymous ftp from expo.lcs.mit.edu in directory
contrib/winterp, file winterp.tar.Z; other files in that directory include
documentation, etc.

-------------------------------------------------------------------------------
	    Niels Mayer -- hplabs!mayer -- mayer@hplabs.hp.com
		  Human-Computer Interaction Department
		       Hewlett-Packard Laboratories
			      Palo Alto, CA.
				   *

max@spam.uchicago.edu (08/05/90)

Several people have asked me to summarize the responses I've received to my
query about shell-callable x interface building tools.  I'm sorry to report
that I've heard of little other than what was also mentioned in follow up
postings in this newsgroup, and I haven't found what I really want:
a shell callable interface to forms, based on public domain widgets.
Still, I have more to report on the programs mentioned in previous postings.

xmenu, which Richard Hesketh (rlh2@ukc.ac.uk) wrote and described in his 
posting, is an interface to menus, based on athena widgets.  It makes and 
works quite nicely under release 4.  It is available by ftp from 
gatekeeper.dec.com in the directory pub/comp.sources.x/xmenu, or from 
uunet.uu.net in comp.sources.x/volume8/xmenu.  

Mr. Hesketh reports that a colleague of his,

    ... has written a form fill-in tool that takes a simple syntax, parses 
    it and displays a form containing different fields for text entry, 
    one-of-many and many-of-many values.  It outputs the results as shell 
    variables which can be EVALuated.  Its needs a little change in the
    syntax before Alison is willing to release it.

xgen uses an opposite design -- instead of an x tool you can call
from a shell script, it is an x tool which calls shell scripts.  More
precisely, you give it a "script" which describes an interface and associates 
shell scripts and other actions with buttons and other user interface features.
There's even fancy constructs like a "spreadsheet" object.  

I haven't been able to get the thing to work, so I'm not sure.  I was using
the old version, based on X11R3 athena widgets, which is still available by 
ftp from gatekeeper.dec.com in pub/comp.sources.x/xgen (or from uunet.uu.net in 
comp.sources.x/volume4/xgen).  It compiled but wouldn't run its sample 
application without crashing.  Apparently Claude Scarpelli 
(scarpell@cnca.cnca-cam.fr) had better success with it at some point, 
since he reported that it's slow.

Jim Westervelt (westerve@zorro.cecer.army.mil), the author of xgen, tells
me that Kurt Buehler (buehlerk%wasser@boulder.colorado.edu) is the current xgen
programmer, and, in his words:

    1) it is better than ever, 2) is based in Motif, 3) is not
    yet documented, and 4) is in testing at my lab.

Carlo Milon (netcom!cmilono@apple.com) suggests: 

    You might look at AT&T's new 'A.L.E.X.' which stands for A Language
    Extension for X, which allows character (i.e., shell) programs to appear
    as X11 interfaces.  I have only seen a simple demonstration of this, but
    it sounds like a way to take *older* character-based apps or simple,
    let's-write-one-now types of things and make them immediately available.

But at present I know nothing more about this.

If anyone kowns about other similar programs, I'd love to hear about them.

Donald Ziff (Max)         Center for Information and Language Studies
                          1100 E. 57th Street, Chicago, Illinois   60637
                          max@estragon.UChicago.{EDU,BITNET,MAILNET,CSNET}
                          ...!uunet!mimsy!oddjob!gargoyle!max