home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / nb.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.3 KB  |  88 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. 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. err: procedure expose sigl rxmuierror
  39. parse arg res
  40. say sigl "["res"]"
  41.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  42.     exit
  43. /***********************************************************************/
  44. createApp: procedure
  45.     app.Title="NumericButton"
  46.     app.Version="$VER: NumericButton 1.0 (10.12.99)"
  47.     app.Copyright="©1999, alfie"
  48.     app.Author="alfie"
  49.     app.Description="NumericButton example"
  50.     app.Base="RXMUIEXAMPLE"
  51.     app.SubWindow="WIN"
  52.      win.ID="MAIN"
  53.      win.Title="NumericButton Example"
  54.      win.Contents="MGROUP"
  55.       mgroup.0="g"
  56.        g.class="group"
  57.        g.horiz=1
  58.         g.0=hspace()
  59.         g.1="ng"
  60.          ng.class="group"
  61.           ng.0="nb0"
  62.            nb0.class="numericbutton"
  63.            nb0.Format="1B63"x || "Val:%lx"
  64.           ng.1="nb1"
  65.            nb1.class="numericbutton"
  66.            nb1.stringify="parse arg val; if val=0 then return '1B63'x || 'None';else return '1B63'x || 'Value:' val"
  67.         g.2=hspace()
  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.     call Notify("nb0","value","everytime","APP","RETURNID")
  79.     call Notify("nb0","value","everytime","nb1","set","value","triggervalue")
  80.     call Notify("nb1","value","everytime","nb0","set","value","triggervalue")
  81.  
  82.     return
  83. /***********************************************************************/
  84. halt:
  85. break_c:
  86.     exit
  87. /**************************************************************************/
  88.