Subject: xprompt uploaded to sunsite
From: [email-masked] (Andrew Tristan)
Date: 30 Jul 1993 10:07:03 -0400
Newsgroups: comp.os.linux.announce

I've uploaded xprompt.tar.z to sunsite.unc.edu:/pub/Linux/Incoming.
xprompt.tar.z contains the source for the xprompt command, it also
includes a binary for XFree 1.3.  It required only a simple
make.  The readme written by the author follows.
Andrew Tristan
[email-masked]
---------------------------------------------------------------------------

Copyright 1989, 1990, 1991 by
Barry Brachman and the University of British Columbia

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of U.B.C. not be used in advertising or
publicity pertaining to distribution of the software without specific,
written prior permission.  U.B.C. makes no representations about the
suitability of this software for any purpose.  It is provided "as is"
without express or implied warranty.

=====

Xprompt provides a means by which programs can ask the user
for one or more responses.  I have found it especially useful for
reducing the size of my (tv)twm menus.
Instead of hardwiring alternatives into a menu, a single script is used
to call xprompt and then invoke the appropriate thing.

For example, I have a twm menu item:

	"RLOGIN"	!"xprompt.rlogin &"

that invokes a shell script called xprompt.rlogin:

#! /bin/sh

defaulthost=${HOME}/.xprompt.rlogin
reply=

if [ -r $defaulthost ]
then
	reply=`cat $defaulthost`
fi

reply=`xprompt -p "Hostname" -r "$reply"`
if [ $? = 1 ]
then
	exit 0
fi
echo "$reply" > $defaulthost

xhost "$reply" > /dev/null 2>&1
xterm -T "rlogin $reply" -e rlogin "$reply" &

exit 0

I set the following resources in my .xresources:
	XPrompt*cursor: left_ptr
	XPrompt*Geometry: 800x30+300+2
	XPrompt*Rlen: 70
	XPrompt*borderWidth: 2
	XPrompt*Grab: off
	XPrompt*Warp: on
	XPrompt*returnExit: on
	XPrompt*textTranslations: #override \n\
                         Ctrl<Key>W:  erase-word() \n\
                         <Btn1Up>: select-start() \n\
                         <Btn2Up>: insert-selection(PRIMARY,CUT_BUFFER0) \n\
                         <Btn3Up>: next-prompt-or-finish()

Xprompt has been written for both X11R4 and X11R5.

I have a man page for trcomp() should anyone think it's a useful library
function.  Ask and I'll mail it.

Please report bugs, enhancements, suggestions, etc. to me rather than
posting to the net.

-----
Barry Brachman           | {alberta,uw-beaver,uunet}!ubc-cs!brachman
Dept. of Computer Science| [email-masked] (cs.ubc.ca=137.82.8.5)
Univ. of British Columbia| [email-masked]
Vancouver, B.C. V6T 1Z2  | Office: (604) 822-3123, FAX: (604) 822-5485

-- 
Andrew Tristan        This message was posted according to weight, not
[email-masked]   volume.  Contents may settle during transmission.

-- 
Send submissions for comp.os.linux.announce to: [email-masked]