home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / ca.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  1.8 KB  |  74 lines

  1. /**/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. if AddLibrary("rxmui.library")~=0 then exit
  8.  
  9. call createApp
  10. call SetNotifies
  11.  
  12. call set("win","open",1)
  13. call getattr("win","open","o")
  14. if o=0 then do
  15.     say "can't open window"
  16.     exit
  17. end
  18.  
  19. call handleApp
  20. exit
  21. /***********************************************************************/
  22. handleApp: procedure
  23. ctrl_c=2**12
  24. s=0
  25. do forever
  26.     call handle("APP","H",s)
  27.     do i=0 to h.num-1
  28.         if h.i="QUIT" then exit
  29.         say h.num-1 h.i
  30.     end
  31.     s=Wait(or(h.signals,ctrl_c))
  32.     if and(s,ctrl_c)>0 then exit
  33. end
  34. exit
  35. /***********************************************************************/
  36. createApp: procedure
  37.     app.Title="Coloradjust"
  38.     app.Version="$VER: Coloradjust 1.0 (10.12.99)"
  39.     app.Copyright="©1999, alfie"
  40.     app.Author="alfie"
  41.     app.Description="Coloradjust example"
  42.     app.Base="Coloradjust"
  43.     app.SubWindow="WIN"
  44.      win.ID="MAIN"
  45.      win.Title="Coloradjust Example"
  46.      win.Contents="MGROUP"
  47.       mgroup.0="ca"
  48.        ca.class="coloradjust"
  49.  
  50.     res=NewObj("APPLICATION","APP")
  51.     if res~=0 then do
  52.         ioerr=IoErr()
  53.         say ioerr
  54.         call err(res)
  55.     end
  56.     return
  57. /***********************************************************************/
  58. setNotifies: procedure
  59.     call Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  60.  
  61.     return
  62. /***********************************************************************/
  63. halt:
  64. break_c:
  65.     exit
  66. /**************************************************************************/
  67. err: procedure expose sigl RxMUIError
  68. parse arg res
  69.     msg = ProgramName()":" GetRxMUIString(res) "in line" sigl-1
  70.     if RxMUIError~="RXMUIERROR" then msg = msg "["RxMUIError"]"
  71.     say msg
  72.     exit
  73. /**************************************************************************/
  74.