home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / IC.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  1.7 KB  |  68 lines

  1. /* Icon example */
  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("rexxsupport.library","rxmui.library")~=0 then exit
  8. call RxMUIOpt("DebugMode ShowErr")
  9.  
  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. CreateApp: procedure
  28.  
  29.     app.Title="IconExample"
  30.     app.Version="$VER: IconExample 1.0 (12.10.2000)"
  31.     app.Copyright="©2000, alfie"
  32.     app.Author="alfie"
  33.     app.Description="IconExample"
  34.     app.Base="RXMUIEXAMPLE"
  35.     app.SubWindow="win"
  36.      win.ID="MAIN"
  37.      win.Title="IconExample"
  38.      win.Contents="MGROUP"
  39.  
  40.       mgroup.0=vspace()
  41.       mgroup.1="gg"
  42.        gg.class="group"
  43.        gg.horiz=1
  44.         gg.0=hspace()
  45.         gg.1="ic"
  46.          ic.class="icon"
  47.          ic.name="sys:disk"
  48.          ic.inputmode="relverify"
  49.          ic.frame="button"
  50.         gg.2=hspace()
  51.       mgroup.2=vspace()
  52.  
  53.     res=NewObj("APPLICATION","APP")
  54.     if res~=0 then exit
  55.  
  56.     call set("win","open",1)
  57.  
  58.     call Notify("win","CloseRequest",1,"app","ReturnID","quit")
  59.     call Notify("ic","pressed",0,"app","return","say 'ic pressed'")
  60.  
  61.     return
  62. /***********************************************************************/
  63. halt:
  64. break_c:
  65.     exit
  66. /**************************************************************************/
  67.  
  68.