summaryrefslogtreecommitdiff
path: root/ipl/gprogs/prompt.icn
diff options
context:
space:
mode:
Diffstat (limited to 'ipl/gprogs/prompt.icn')
-rw-r--r--ipl/gprogs/prompt.icn44
1 files changed, 44 insertions, 0 deletions
diff --git a/ipl/gprogs/prompt.icn b/ipl/gprogs/prompt.icn
new file mode 100644
index 0000000..4450271
--- /dev/null
+++ b/ipl/gprogs/prompt.icn
@@ -0,0 +1,44 @@
+############################################################################
+#
+# File: prompt.icn
+#
+# Subject: Program to prompt in a window
+#
+# Author: Clinton L. Jeffery
+#
+# Date: June 17, 1994
+#
+############################################################################
+#
+# This file is in the public domain.
+#
+############################################################################
+#
+# A utility for interactive shell scripts. Called from a
+# shell script, it pops up a window, writes its arguments out as
+# a prompt, and echos the user's response to standard output where
+# the shell script can use it (by means of the backquote character).
+#
+############################################################################
+#
+# Requires: Version 9 graphics
+#
+############################################################################
+#
+# Links: wopen
+#
+############################################################################
+
+link wopen
+
+procedure main(args)
+ local s2, w
+
+ pos := "pos="
+ every s2 := QueryPointer() do pos ||:= (s2-10) || ","
+
+ w := WOpen("label=prompt", "cursor=on", "font="||("12x24"|"fixed"),
+ "lines=1", pos[1:-1]) | stop("opening the window fails")
+ every writes(w,!args," ")
+ write(read(w))
+end