home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 4934 < prev    next >
Encoding:
Text File  |  1992-07-24  |  1.6 KB  |  46 lines

  1. Newsgroups: comp.lang.perl
  2. 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
  3. From: rahardj@ccu.umanitoba.ca (Budi Rahardjo)
  4. Subject: Re: X thing to get string?
  5. Message-ID: <1992Jul24.114027.25937@ccu.umanitoba.ca>
  6. Sender: news@ccu.umanitoba.ca
  7. Nntp-Posting-Host: varley.cc.umanitoba.ca
  8. Organization: University of Manitoba, Winnipeg, Canada
  9. References: <1992Jul22.161235.18528@cs.unca.edu>
  10. Date: Fri, 24 Jul 1992 11:40:27 GMT
  11. Lines: 33
  12.  
  13. mcmahan@cs.unca.edu (Scott McMahan -- Genesis mailing list owner) writes:
  14. >Is there an X program, preferably Motif-oriented (not that I'm that
  15. >picky :^)), that will pop a dialogue box, get a string from the user,
  16. >and print it on the stdout?
  17.  
  18. In X-icon (X extension of Icon) there is an example of such program
  19. called 'xprompt'. It generates a small executable too.
  20.  
  21. -- budi
  22.  
  23. If you're curious, here is the program :
  24.  
  25. #    Name:    xprompt.icn
  26. #    Title:    X Prompt
  27. #    Author:    Clinton L. Jeffery
  28. #    Date:    Sept 17, 1991
  29. #
  30. # An X-Icon utility for interactive shell scripts.  Called from a
  31. # shell script, it pops up an X window, writes its arguments out as
  32. # a prompt, and echos the user's response to standard output where
  33. # the shell script can use it (by means of the backquote character).
  34. #
  35. procedure main(args)
  36.   pos := "pos="
  37.   every s2 := XQueryPointer() do pos ||:= (s2-10) || ","
  38.   w := open("xprompt","x","font=12x24","lines=1",pos[1:-1]) |
  39.      stop("opening the window fails")
  40.   every writes(w,!args," ")
  41.   write(read(w))
  42. end
  43. -- 
  44. Budi Rahardjo <rahardj@ccu.umanitoba.ca>
  45. Unix Support - Computer Services - University of Manitoba
  46.