home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / FINCAL2.DMS / in.adf / FCrexx.lha / Window_Drawing.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1995-03-04  |  1.1 KB  |  53 lines

  1.  
  2. /* Sample ARexx User-defined requester  */
  3.  
  4. if ~show('l', "rexxsupport.library") then
  5.     addlib('rexxsupport.library',0,-30,0)
  6.  
  7. options results
  8.  
  9. portname = 'MYPORT'
  10. shutdown = 0
  11. if openport(portname) then do
  12.  
  13. window allocate     /* request a new window object */
  14. win = result        /* store window object # in 'win' */
  15. window win gadget 1 10 165 100 0 ok 0 "Use" "use"
  16. window win gadget 0 126 165 100 0 reset 0 "Reset" "reset"
  17. window win gadget 0 242 165 100 0 cancel 0 "Cancel" "cancel"
  18.  
  19. window win open 365 200 '"Test Requester..."' async portname notify reset
  20. woi = result
  21. if woi ~= null() then do
  22.  
  23. woi mode jam1
  24. woi pen 1 
  25. woi line 10 20 100 20
  26. woi pen 2 
  27. woi draw 30 30
  28. woi box 10 100 200 150
  29. woi mode complement
  30. woi rect 100 50 300 120
  31.  
  32.   do until shutdown
  33.  
  34.     call waitpkt(portname)
  35.     msg = getpkt(portname)
  36.  
  37.     if msg ~= '0000 0000'x then do
  38.       cmd = getarg(msg)
  39.  
  40.       if upper(cmd)='USE' then
  41.         shutdown = 1
  42.  
  43.       if upper(cmd)='CANCEL' then
  44.         shutdown = 1
  45.  
  46.       call reply(msg,0)
  47.       end
  48.     end
  49.   end
  50. call closeport(portname)
  51. window win free             /* free all window resources */
  52. end
  53.