home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 19 / AACD19.BIN / AACD / Programming / rxmui / examples / appwin.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-01-29  |  2.2 KB  |  83 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.     return
  15. /***********************************************************************/
  16. handleApp: procedure
  17.     ctrl_c=2**12
  18.     do forever
  19.         call NewHandle("APP","H",ctrl_c)
  20.         if and(h.signals,ctrl_c)>0 then exit
  21.         select
  22.             when h.event="QUIT" then exit
  23.             when h.event="APPEVENT" then call appFun(h.to,h.name)
  24.             otherwise interpret h.event
  25.         end
  26.     end
  27.     /* never reached */
  28. /***********************************************************************/
  29. err: procedure expose sigl RxMUIError
  30. parse arg res
  31.     msg = ProgramName()":" GetRxMUIString(res) "in line" sigl-1
  32.     if RxMUIError~="RXMUIERROR" then msg = msg "["RxMUIError"]"
  33.     say msg
  34.     exit
  35. /***********************************************************************/
  36. CreateApp: procedure
  37.  
  38.     app.Title="AppWindowExample"
  39.     app.Version="$VER: AppWindowExample 2.0 (12.10.2000)"
  40.     app.Copyright="©2000, alfie"
  41.     app.Author="alfie"
  42.     app.Description="AppWindowExample"
  43.     app.Base="RXMUIEXAMPLE"
  44.     app.SubWindow="win"
  45.      win.Title="AppWindowExample"
  46.      win.AppWindow=1
  47.      win.Contents="mgroup"
  48.       mgroup.frametitle="Drop icons on me!"
  49.       mgroup.0="droplist"
  50.        droplist.class="listview"
  51.        droplist.input=1
  52.        droplist.frame="inputlist"
  53.        droplist.list="list"
  54.  
  55.     res=NewObj("APPLICATION","APP")
  56.     if res~=0 then call err(res)
  57.  
  58.     call Notify("win","closerequest",1,"app","returnid","quit")
  59.     say Notify("droplist","entries","everytime","droplist","jump","triggervalue")
  60.  
  61.     call AppMessage("droplist")
  62.  
  63.     call set("win","open",1)
  64.     call getattr("win","open","o")
  65.     if o=0 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,name
  78.     res = DoMethod(to,"insert",name,"bottom")
  79.     if res~=0 then call err(res)
  80.  
  81.     return
  82. /**************************************************************************/
  83.