home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / Pkb.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  2.4 KB  |  94 lines

  1. /* Piano keyboard example */
  2.  
  3. call rxmuiopt("debugmode showerr")
  4. call setrxmuistack(128000)
  5.  
  6. signal on halt
  7. signal on break_c
  8.  
  9. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  10. if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
  11.  
  12. call createApp
  13. call SetNotifies
  14.  
  15. call set("win","open",1)
  16.  
  17. call handleApp
  18. exit
  19. /***********************************************************************/
  20. handleApp: procedure
  21.     ctrl_c=2**12
  22.     do forever
  23.         call newhandle("app","h",ctrl_c)
  24.         if and(h.signals,ctrl_c)>0 then exit
  25.         select
  26.             when h.event="QUIT" then exit
  27.             otherwise nop
  28.         end
  29.     end
  30.  
  31. /***********************************************************************/
  32. err: procedure expose sigl rxmuierror
  33. parse arg res
  34. say sigl "["res"]"
  35.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  36.     exit
  37. /***********************************************************************/
  38. createApp: procedure
  39.     app.Title="Keyboard"
  40.     app.Version="$VER: Keyboard 1.0 (10.12.99)"
  41.     app.Copyright="©1999, alfie"
  42.     app.Author="alfie"
  43.     app.Description="Keyboard example"
  44.     app.Base="KEYBOARD"
  45.     app.SubWindow="WIN"
  46.      win.ID="MAIN"
  47.      win.Title="Keyboard Example"
  48.      win.Contents="MGROUP"
  49.  
  50.       mgroup.0="g"
  51.        g.class="group"
  52.  
  53.         g.0="spkb1"
  54.          spkb1.class="Scrollgroup"
  55.          spkb1.VirtgroupContents="pkb1"
  56.          spkb1.FreeVert=0
  57.           spkb1.0="pkb1"
  58.            pkb1.class="pkb"
  59.            pkb1.PkbOctvStart=1
  60.            pkb1.PkbOctvRange=11
  61.            pkb1.PkbOctvName=1
  62.            pkb1.PkbOctvBase=-2
  63.            pkb1.PkbExcludeHigh=4
  64.  
  65.         g.1="spkb2"
  66.          spkb2.class="Scrollgroup"
  67.          spkb2.FreeVert=0
  68.          spkb2.VirtgroupContents="pkb2"
  69.            pkb2.class="pkb"
  70.            pkb2.PkbOctvStart=1
  71.            pkb2.PkbOctvRange=11
  72.            pkb2.PkbOctvName=1
  73.            pkb2.PkbOctvBase=-2
  74.            pkb2.PkbExcludeHigh=4
  75.            pkb2.PkbType="Small"
  76.  
  77.     res=NewObj("APPLICATION","APP")
  78.     if res~=0 then call err(res)
  79.  
  80.     return
  81. /***********************************************************************/
  82. setNotifies: procedure
  83.     res=Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  84.     if res~=0 then call err(res)
  85.  
  86.  
  87.     return
  88. /***********************************************************************/
  89. halt:
  90. break_c:
  91.     exit
  92. /**************************************************************************/
  93.  
  94.