home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!unixg.ubc.ca!kakwa.ucs.ualberta.ca!access.usask.ca!ccu.umanitoba.ca!rahardj
- From: rahardj@ccu.umanitoba.ca (Budi Rahardjo)
- Subject: Re: X thing to get string?
- Message-ID: <1992Jul24.114027.25937@ccu.umanitoba.ca>
- Sender: news@ccu.umanitoba.ca
- Nntp-Posting-Host: varley.cc.umanitoba.ca
- Organization: University of Manitoba, Winnipeg, Canada
- References: <1992Jul22.161235.18528@cs.unca.edu>
- Date: Fri, 24 Jul 1992 11:40:27 GMT
- Lines: 33
-
- mcmahan@cs.unca.edu (Scott McMahan -- Genesis mailing list owner) writes:
- >Is there an X program, preferably Motif-oriented (not that I'm that
- >picky :^)), that will pop a dialogue box, get a string from the user,
- >and print it on the stdout?
-
- In X-icon (X extension of Icon) there is an example of such program
- called 'xprompt'. It generates a small executable too.
-
- -- budi
-
- If you're curious, here is the program :
-
- # Name: xprompt.icn
- # Title: X Prompt
- # Author: Clinton L. Jeffery
- # Date: Sept 17, 1991
- #
- # An X-Icon utility for interactive shell scripts. Called from a
- # shell script, it pops up an X 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).
- #
- procedure main(args)
- pos := "pos="
- every s2 := XQueryPointer() do pos ||:= (s2-10) || ","
- w := open("xprompt","x","font=12x24","lines=1",pos[1:-1]) |
- stop("opening the window fails")
- every writes(w,!args," ")
- write(read(w))
- end
- --
- Budi Rahardjo <rahardj@ccu.umanitoba.ca>
- Unix Support - Computer Services - University of Manitoba
-