home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 19 / AACD19.BIN / AACD / Programming / rxmui / examples / cy.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-01-29  |  1.8 KB  |  79 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 set("radio","active",2)
  20.  
  21. call handleApp
  22. exit
  23. /***********************************************************************/
  24. handleApp: procedure
  25. ctrl_c=2**12
  26. s=0
  27. do forever
  28.     call handle("APP","H",s)
  29.     do i=0 to h.num-1
  30.         if h.i="QUIT" then exit
  31.         say h.num-1 h.i
  32.     end
  33.     s=Wait(or(h.signals,ctrl_c))
  34.     if and(s,ctrl_c)>0 then exit
  35. end
  36. exit
  37. /***********************************************************************/
  38. createApp: procedure
  39.  
  40.     win.ID="MAIN"
  41.     win.Title="CompactWindow Example"
  42.     win.NOGADGETS=1
  43.     win.SIZEGADGET=0
  44.     win.Contents="MGROUP"
  45.      mgroup.0="radio"
  46.       radio.class="cycle"
  47.       radio.entries="uno|due|tre"
  48.     res=NewObj("compactwindow","win")
  49.     if res~=0 then call err(res)
  50.  
  51.     app.Title="CompactWindow"
  52.     app.Version="$VER: CompactWindow 1.0 (10.12.99)"
  53.     app.Copyright="©1999, alfie"
  54.     app.Author="alfie"
  55.     app.Description="CompactWindow example"
  56.     app.Base="RXMUIEXAMPLE"
  57.     app.SubWindow="WIN"
  58.     res=NewObj("APPLICATION","APP")
  59.     if res~=0 then call err(res)
  60.  
  61.     return
  62. /***********************************************************************/
  63. setNotifies: procedure
  64.     res=Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  65.     if res~=0 then call err(res)
  66.     return
  67. /***********************************************************************/
  68. halt:
  69. break_c:
  70.     exit
  71. /**************************************************************************/
  72. err: procedure expose sigl RxMUIError
  73. parse arg res
  74.     msg = ProgramName()":" GetRxMUIString(res) "in line" sigl-1
  75.     if RxMUIError~="RXMUIERROR" then msg = msg "["RxMUIError"]"
  76.     say msg
  77.     exit
  78. /**************************************************************************/
  79.