home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / FileMover / HF-OM3.DMS / in.adf / ARexx.lha / ARexx / icontest.dopus5 < prev    next >
Encoding:
Text File  |  1996-05-20  |  942 b   |  53 lines

  1. /* */
  2.  
  3. address DOPUS.1
  4. options results
  5. options failat 11
  6.  
  7. dopus front
  8.  
  9. if ~show('l','rexxsupport.library') then
  10.     call addlib('rexxsupport.library',0,-30,0)
  11.  
  12. call openport('test-handler')
  13.  
  14. /* set up menu items */
  15. iconmenu.count=3
  16. iconmenu.0='foo'
  17. iconmenu.1='bar'
  18. iconmenu.2='baz'
  19.  
  20. /* add an icon */
  21. dopus addappicon 'test-handler' "'Test Icon'" 1 info snap close local menu iconmenu.
  22. icon=result
  23.  
  24. say 'Icon added.. play with it. To remove, select Close from the popup menu'
  25.  
  26. flag = 0
  27.  
  28. /* loop around */
  29. do while flag = 0
  30.     call waitpkt('test-handler')
  31.  
  32.     packet=getpkt('test-handler')
  33.     arg0=getarg(packet,0)
  34.     arg1=getarg(packet,1)
  35.     arg2=getarg(packet,2)
  36.     arg3=getarg(packet,3)
  37.     arg4=getarg(packet,4)
  38.  
  39.     say 'Arg0:' arg0
  40.     say 'Arg1:' arg1
  41.     say 'Arg2:' arg2
  42.     say 'Arg3:' arg3
  43.     say 'Arg4:' arg4
  44.  
  45.     call reply(packet,0)
  46.  
  47.     if arg0 = 'close' then flag = 1
  48.     if arg0 = 'removed' then flag = 2
  49. end
  50.  
  51. /* remove icon */
  52. if flag~=2 then dopus remappicon icon
  53.