home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 19 / AACD19.BIN / AACD / Programming / rxmui / examples / popa.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-01-29  |  2.0 KB  |  78 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 RxMUIOpt("debugmode showerr")
  10. call CreateApp
  11. call HandleApp
  12. /* never reached */
  13. /***********************************************************************/
  14. HandleApp: procedure
  15.  
  16.     ctrl_c=2**12
  17.     do forever
  18.         call NewHandle("app","h",ctrl_c)
  19.         if and(h.signals,ctrl_c)>0 then exit
  20.         select
  21.             when h.event="QUIT" then exit
  22.             otherwise interpret h.event
  23.         end
  24.     end
  25.     /* never reached */
  26. /***********************************************************************/
  27. err: procedure expose sigl rxmuierror
  28. parse arg res
  29. say sigl "["res"]"
  30.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  31.     exit
  32. /***********************************************************************/
  33. CreateApp: procedure
  34.  
  35.     app.Title="PopaslExample"
  36.     app.Version="$VER: PopaslExample 1.0 (12.10.2000)"
  37.     app.Copyright="©2000, alfie"
  38.     app.Author="alfie"
  39.     app.Description="PopaslExample"
  40.     app.Base="RXMUIEXAMPLE"
  41.     app.SubWindow="win"
  42.      win.ID="MAIN"
  43.      win.Title="PopaslExample"
  44.      win.Contents="MGROUP"
  45.  
  46.       mgroup.0="popu"
  47.        popu.class="popasl"
  48.         popu.FilterMacro="parse arg a,b,c;call set(info,contents,ciao);return pos('.c',a)>0"
  49.        popu.DomultiSelect=1
  50.        popu.AcceptPattern="#?"
  51.        popu.RejectPattern="#?.o"
  52.         url.Maxlen=16000
  53.        popu.String=string("url")
  54.        popu.DoPattern=1
  55.        popu.SleepWindow=1
  56.        popu.InitialPattern="#?"
  57.       mgroup.1=Text("info")
  58.  
  59.     res=NewObj("APPLICATION","APP")
  60.     if res~=0 then call err(res)
  61.  
  62.     call set("win","open",1)
  63.     call getattr("win","open","o")
  64.     if o=0 then do
  65.         say "can't open window"
  66.         exit
  67.     end
  68.  
  69.     call Notify("win","CloseRequest",1,"app","ReturnID","quit")
  70.     call notify("url","newcontents","everytime",info,set,contents,triggervalue)
  71.  
  72.     return
  73. /***********************************************************************/
  74. halt:
  75. break_c:
  76.     exit
  77. /**************************************************************************/
  78.