home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / sviluppo / rxmui / examples / mt.rexx < prev    next >
OS/2 REXX Batch file  |  1999-12-21  |  2KB  |  97 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 setrxmuistack(512000)*/
  10. call rxmuiopt("debugmode showerr")
  11.  
  12. call createApp
  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.  
  26. ctrl_c=2**12
  27. s=0
  28. do forever
  29.     call handle("APP","H",s)
  30.     do i=0 to h.num-1
  31.         if h.i="QUIT" then do
  32.             exit
  33.             call set("win","open",0)
  34.             exit
  35.         end
  36.         say h.num-1 h.i
  37.     end
  38.     s=Wait(or(h.signals,ctrl_c))
  39.     if and(s,ctrl_c)>0 then exit
  40. end
  41. /* never reached */
  42. /***********************************************************************/
  43. err: procedure expose sigl rxmuierror
  44. parse arg res
  45. say sigl "["res"]"
  46.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  47.     exit
  48. /***********************************************************************/
  49. createApp: procedure
  50.     app.Title="MailText"
  51.     app.Version="$VER: MailText 1.0 (10.12.99)"
  52.     app.Copyright="©1999, alfie"
  53.     app.Author="alfie"
  54.     app.Description="MailText example"
  55.     app.Base="MailText"
  56.     app.SubWindow="WIN"
  57.      win.ID="MAIN"
  58.      win.Title="Mailtext Example"
  59.      win.Contents="MGROUP"
  60.       mgroup.0="nlv"
  61.        nlv.class="nlistview"
  62.        nlv.frame="READLIST"
  63.        nlv.list="mt"
  64.        nlv.input=1
  65.         mt.font="fixed"
  66.         mt.class="mailtext"
  67.         mt.text=ParseText("Alfonso Ranieri\n\nmailto:alforan@tin.it\nhttp://wen.tiscalinet.it/amiga/rxmui/")
  68.       mgroup.1="gb"
  69.        gb.class="group"
  70.        gb.horiz=1
  71.        gb.0=Label("May also use this special text object:")
  72.        gb.1="b"
  73.         b.class="text"
  74.         b.inputmode="toggle"
  75.         b.frame="none"
  76.         b.background="windowback"
  77.         b.showselstate=0
  78.         b.contents="Ciao"
  79.  
  80.     res=NewObj("APPLICATION","APP")
  81.     if res~=0 then do
  82.         ioerr=IoErr()
  83.         say ioerr
  84.         call err(res)
  85.     end
  86.  
  87.     call Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  88.  
  89.     say Notify("B","PRESSED","everytime","APP","RETURNID")
  90.  
  91.     return
  92. /***********************************************************************/
  93. halt:
  94. break_c:
  95.     exit
  96. /**************************************************************************/
  97.