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

  1. /**/
  2.  
  3. call rxmuiopt("debugmode showerr")
  4.  
  5. signal on halt
  6. signal on break_c
  7.  
  8. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  9. if AddLibrary("rxmui.library")~=0 then exit
  10.  
  11. call createApp
  12. call SetNotifies
  13.  
  14. call set("win","open",1)
  15. call getattr("win","open","o")
  16. if o=0 then do
  17.     say "can't open window"
  18.     exit
  19. end
  20.  
  21. call handleApp
  22. exit
  23. /***********************************************************************/
  24. handleApp: procedure
  25. ctrl_c=2**12
  26. do forever
  27.     call newhandle("APP","H",ctrl_c)
  28.     if and(h.signals,ctrl_c)>0 then exit
  29.     select
  30.         when h.event="QUIT" then exit
  31.         otherwise interpret h.event
  32.     end
  33. end
  34. exit
  35. /***********************************************************************/
  36. err: procedure expose sigl rxmuierror
  37. parse arg res
  38. say sigl "["res"]"
  39.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  40.     exit
  41. /***********************************************************************/
  42. createApp: procedure
  43.     app.Title="Wheel"
  44.     app.Version="$VER: Wheel 1.0 (10.12.99)"
  45.     app.Copyright="©1999, alfie"
  46.     app.Author="alfie"
  47.     app.Description="Wheel example"
  48.     app.Base="RXMUIEXAMPLE"
  49.     app.SubWindow="WIN"
  50.      win.ID="MAIN"
  51.      win.Title="Wheel Example"
  52.      win.Contents="MGROUP"
  53.       mgroup.0="wh"
  54.         wh.class="wheel"
  55.         wh.frame="button"
  56.         wh.min=0
  57.         wh.max=1000000
  58.         wh.value=1000
  59.         wh.wheelinfinit=1
  60.  
  61.       mgroup.1="whh"
  62.         whh.class="wheel"
  63.         whh.frame="readlist"
  64.         whh.wheelhoriz=1
  65.         whh.min=0
  66.         whh.max=1000000
  67.         whh.value=1000
  68.  
  69.     res=NewObj("APPLICATION","APP")
  70.     if res~=0 then call err(res)
  71.  
  72.     return
  73. /***********************************************************************/
  74. setNotifies: procedure
  75.     res=Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  76.     if res~=0 then call err(res)
  77.  
  78.     res=Notify("wh","value","everytime","APP","RETURN","say 'V' h.value","triggerattr")
  79.     if res~=0 then call err(res)
  80.  
  81.     res=Notify("whh","value","everytime","APP","RETURN","say 'H' h.value","triggerattr")
  82.     if res~=0 then call err(res)
  83.  
  84.     return
  85. /***********************************************************************/
  86. halt:
  87. break_c:
  88.     exit
  89. /**************************************************************************/
  90.