home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / appwin.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.4 KB  |  84 lines

  1. /* AppWindowExample */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. call init
  7. call CreateApp
  8. call HandleApp
  9. /* never reached */
  10. /***********************************************************************/
  11. init: procedure
  12.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  13.     if AddLibrary("rxmui.library")~=0 then exit
  14.     call RxMUIOpt("DebugMode ShowErr")
  15.     return
  16. /***********************************************************************/
  17. handleApp: procedure
  18.     ctrl_c=2**12
  19.     do forever
  20.         call NewHandle("APP","H",ctrl_c)
  21.         if and(h.signals,ctrl_c)>0 then exit
  22.         select
  23.             when h.event="QUIT" then exit
  24.             when h.event="APPEVENT" then call appFun(h.to,h.name)
  25.             otherwise interpret h.event
  26.         end
  27.     end
  28.     /* never reached */
  29. /***********************************************************************/
  30. CreateApp: procedure
  31.  
  32.     app.Title="AppWindowExample"
  33.     app.Version="$VER: AppWindowExample 2.1 (11.3.2001)"
  34.     app.Copyright="©2001, alfie"
  35.     app.Author="alfie"
  36.     app.Description="AppWindowExample"
  37.     app.Base="RXMUIEXAMPLE"
  38.     app.SubWindow="win"
  39.      win.Title="AppWindowExample"
  40.      win.AppWindow=1
  41.      win.Contents="mgroup"
  42.       mgroup.frametitle="Drop icons on me!"
  43.       mgroup.0="droplist1"
  44.        droplist1.class="listview"
  45.        droplist1.input=1
  46.        droplist1.list="list"
  47.         list.frame="inputlist"
  48.       mgroup.1="droplist2"
  49.        droplist2.class="listview"
  50.        droplist2.input=1
  51.        droplist2.list="dlist"
  52.         dlist.class="dirlist"
  53.         dlist.frame="inputlist"
  54.  
  55.     res=NewObj("APPLICATION","APP")
  56.     if res~=0 then exit
  57.  
  58.     call Notify("win","closerequest",1,"app","returnid","quit")
  59.     call Notify("droplist1","entries","everytime","droplist1","jump","triggervalue")
  60.  
  61.     call AppMessage("droplist1")
  62.     call AppMessage("droplist2")
  63.  
  64.     call set("win","open",1)
  65.     if ~xget("win","open") then do
  66.         say "can't open window"
  67.         exit
  68.     end
  69.  
  70.     return
  71. /***********************************************************************/
  72. halt:
  73. break_c:
  74.     exit
  75. /**************************************************************************/
  76. appFun: procedure
  77. parse arg to,what
  78. say to what
  79.     if to="DROPLIST1" then call DoMethod(to,"insert",what,"bottom")
  80.     else call set("dlist","DIRECTORY",what)
  81.  
  82.     return
  83. /**************************************************************************/
  84.