From paperboy.osf.org!LoVerso.Southborough.MA.US!John Fri Dec 10 13:12:04 1993
Article: 8909 of comp.lang.tcl
Path: paperboy.osf.org!LoVerso.Southborough.MA.US!John
From: John Robert LoVerso <John@LoVerso.Southborough.MA.US>
Newsgroups: comp.lang.tcl
Subject: tkprompt & xtext-bind
Date: 1 Dec 1993 02:51:37 GMT
Organization: John & Sue's House, Southborough MA
Lines: 529
Sender: John Robert LoVerso <John@LoVerso.Southborough.MA.US>
Message-ID: <30Nov93.213342@LoVerso.Southborough.MA.US>
Reply-To: John Robert LoVerso <John@LoVerso.Southborough.MA.US>
NNTP-Posting-Host: coltsfoot.osf.org
Summary: xprompt tool && multiline entry widget
Return-Path: John Robert LoVerso <John@LoVerso.Southborough.MA.US>
Originator: loverso@coltsfoot.osf.org

This is a small program called "tkprompt" that works just like the
xprompt (or xprompt2) program in the X contrib repository.  It pops up
a window containing one or more prompts and an input areas.  Each input
area can have an initial value.  The user can traverse between the
different inputs areas and enter responses to the prompts.  It is a
two-way xmessage, in effect.

The hightlight of the widget with the focus is done by increasing
the border width of the widget.  Normally each widget has a bw of 2
and a pack padding of 2.  When it has the focus, it gets a bw of 4
and a padding of 0.  This works well for the text widgets used.

The other interesting item is my "xtext" library.  tkprompt will
use this if you install it.  It provides some bindings and behaviors
reminiscent of the damnable Athena text widget.  That is, that same
old horrible set of emacs-like bindings.  [I'll fix this as soon as
I get more free time to work on tkvi].

The other thing xtext provides is the ability to dynamically expand
the size of the text widget so that there is no need for scrollbars
or scanning.  This is the logical equivalent of the "resizable" or
"AllowShellResize" Athena widget option.  The fancy thing about this
is that tkprompt starts with a 20-unit wide input area, but as you
type toward the right margin or hit ^J for a new line, it grows
accordingly.  This becomes a handy multi-line entry widget.

I hope this is useful to someone.

I use this as:

	env DISPLAY=(someone else's display) \
		tkprompt -p "When is a good time for lunch?" -r "noon" \
			-p "(and be on time)"

John

