home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / pops.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  3.0 KB  |  99 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="PopstringExample"
  36.     app.Version="$VER: PopstringExample 1.0 (12.10.2000)"
  37.     app.Copyright="©2000, alfie"
  38.     app.Author="alfie"
  39.     app.Description="PopstringExample"
  40.     app.Base="RXMUIEXAMPLE"
  41.     app.SubWindow="WIN"
  42.      win.Title="PopstringExample"
  43.      win.ID="MAIN"
  44.      win.Contents="mgroup"
  45.  
  46.       mgroup.0="G"
  47.        g.class="group"
  48.        g.horiz=1
  49.        g.0="ps"
  50.         ps.class="popstring"
  51.         ps.toggle=1
  52.         ps.openfun="call set('l','quiet',1);pl=show('p',,'/');do while pl~='';parse var pl p '/' pl;call domethod('l','insert',p,'sorted');end;call set('l','quiet',0);return 1"
  53.         ps.closefun="call domethod('l','clear')"
  54.         ps.string=String("S")
  55.         ps.button=Button("BS","Pop!")
  56.         ps.window="pw"
  57.          pw.class="window"
  58.          pw.Title="PopstringWindow"
  59.          pw.ID="SHOW"
  60.          pw.refwin="win"
  61.           pw.Contents="pwmain"
  62.            pwmain.0="lv"
  63.             lv.class="listview"
  64.             lv.list="l"
  65.              l.frame="inputlist"
  66.            pwmain.1=Button("cs",'_Button')
  67.  
  68.     res=NewObj("APPLICATION","APP")
  69.     if res~=0 then call err(res)
  70.  
  71.     call notify("win","CloseRequest",1,"app","ReturnID","quit")
  72.     call notify("ps","open",1,"app","return","say 'pop opened'")
  73.     call notify("ps","open",0,"app","return","say 'pop closed'")
  74.     call notify("ps","success",1,"app","return","say 'pop closed with success'")
  75.     call notify("ps","success",0,"app","return","say 'pop closed with failure'")
  76.     call notify("pw","CloseRequest",1,"ps","close",0)
  77.     call notify("cs","pressed",0,"ps","close",1)
  78.  
  79.     call add("app","pw")
  80.  
  81.     call set("win","open",1)
  82.     call getattr("win","open","o")
  83.     if o=0 then do
  84.         say "can't open window"
  85.         exit
  86.     end
  87.  
  88.     return
  89. /***********************************************************************/
  90. halt:
  91. break_c:
  92.     exit
  93. /**************************************************************************/
  94. popofun: procedure
  95.     call DoMethod('list','GetEntry','active','A')
  96.     call set('s','contents',a)
  97.     return
  98. /**************************************************************************/
  99.