home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / gprogs / snapper.icn < prev    next >
Text File  |  2001-05-02  |  2KB  |  64 lines

  1. ############################################################################
  2. #
  3. #    File:     snapper.icn
  4. #
  5. #    Subject:  Program to display images
  6. #
  7. #    Authors:  Ralph E. Griswold and Clinton L. Jeffery
  8. #
  9. #    Date:     May 2, 2001
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This is just a simple program to display black-and-white versions of screen
  18. #  dumps.
  19. #
  20. #  Type the name of an XBM or XPM file on the prompt in the input window.
  21. #  Get rid of an image by click in the image window.  Exit the program
  22. #  by clicking in the input window.
  23. #
  24. #  As an exercise, you might want to make this program more versatile --
  25. #  and perhaps write a program to do slide shows.
  26. #
  27. ############################################################################
  28. #
  29. #  Requires:  Version 9 graphics
  30. #
  31. ############################################################################
  32. #
  33. #  Links:  wopen
  34. #
  35. ############################################################################
  36.  
  37. link wopen
  38.  
  39. procedure main(av)
  40.    local name, window, winput
  41.  
  42.    if *av > 0 then {
  43.       every name := !av do {
  44.          (window := WOpen("label=" || name, "image=" || name,"pos=400,200")) | 
  45.             write(&errout,"cannot open image ",name)
  46.      }
  47.       Active()
  48.    } else {
  49.       winput := WOpen("label=snapper! (click mouse in this window to exit)") |
  50.      stop("** can't open window")
  51.  
  52.       repeat {
  53.      close(\window)
  54.      writes(winput, "next image: ")
  55.      name := read(winput)
  56.      (window := WOpen("label=" || name, "image=" || name,"pos=400,200")) | 
  57.         write(winput,"cannot open image")
  58.          if Event(winput) === (&lpress | &mpress | &rpress) then
  59.             exit()
  60.       }
  61.    }
  62.    
  63. end
  64.