home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / sviluppo / rxmui / examples / win.rexx < prev    next >
OS/2 REXX Batch file  |  1999-12-21  |  2KB  |  75 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. err: procedure expose sigl rxmuierror
  37. parse arg res
  38. say signl "["res"]"
  39.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  40.     exit
  41. /***********************************************************************/
  42. createApp: procedure
  43.     app.Title="LitteExample"
  44.     app.Version="$VER: LitteExample 1.0 (10.12.99)"
  45.     app.Copyright="©1999, alfie"
  46.     app.Author="alfie"
  47.     app.Description="Just a little example"
  48.     app.Base="EXAMPLE"
  49.     app.SubWindow="WIN"
  50.      win.ID="MAIN"
  51.      win.Title="A LitteExample"
  52.      win.Contents="MGROUP"
  53.       mgroup.0="G"
  54.        g.frame="GROUP"
  55.        g.class="GROUP"
  56.        g.columns=2
  57.        g.0=label("_Name","DOUBLE")
  58.        name.cyclechain=1; g.1=String("NAME","n")
  59.        g.2=label("_Surname","DOUBLE")
  60.        surname.cyclechain=1; g.3=String("surname","s")
  61.  
  62.     res=NewObj("APPLICATION","APP")
  63.     if res~=0 then call err(res)
  64.     return
  65. /***********************************************************************/
  66. setNotifies: procedure
  67.     res=Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  68.     if res~=0 then call err(res)
  69.     return
  70. /***********************************************************************/
  71. halt:
  72. break_c:
  73.     exit
  74. /**************************************************************************/
  75.