home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 499.lha / RexxIntuition_rel2 / Menus.rexx < prev    next >
OS/2 REXX Batch file  |  1991-04-08  |  2KB  |  56 lines

  1. /* An example of using the dissidents rx_intui.library */
  2.  
  3. wind=GetWindow('Try Menus',,,,,,,,,)
  4. IF wind == '' | wind == 0 THEN SAY 'Window open error'
  5.  
  6. /* Add first menu */
  7. menu=AddMenu(wind,'Project',0,90)
  8. IF menu == '' | menu == 0 THEN Text('Menu error',wind,5,12)
  9. /* Add the first item to menu 1 */
  10. item=AddItem(menu,'Load',,,,,wind)
  11. IF item == '' | item == 0 THEN Text('Menu error',wind,5,12)
  12. /* Add a second item to menu 1. Note that I set COMMSEQ (4) flag and specify 'Q' */
  13. /* Also, I've set this item up to issue a CLOSEWINDOW with OK state */
  14. item=AddItem(menu,'Quit',4,,128+1,'Q',wind)
  15. IF item == '' | item == 0 THEN Text('Menu error',wind,5,12)
  16.  
  17. /* Add the second menu */
  18. menu=AddMenu(wind,'Menu 2',100,90)
  19. IF menu == '' | menu == 0 THEN Text('Menu error',wind,5,12)
  20. /* Add the first item to menu 2 */
  21. item=AddItem(menu,'Item 1',,,,,wind)
  22. IF item == '' | item == 0 THEN Text('Menu error',wind,5,12)
  23. /* Add the second item to menu 2 */
  24. item=AddItem(menu,'Item 2',,,,,wind)
  25. IF item == '' | item == 0 THEN Text('Menu error',wind,5,12)
  26. /* Add 1st subitem to Item 2 of this menu. Make this HIGHBOX */
  27. sub=AddSub(item,'SubItem 1',128,,,,wind)
  28. IF sub == '' | sub == 0 THEN Text('Menu error',wind,5,12)
  29. /* Add 2nd subitem to Item 2 of this menu. */
  30. sub=AddSub(item,'SubItem 2',,,,,wind)
  31. IF sub == '' | sub == 0 THEN Text('Menu error',wind,5,12)
  32. /* Add 3rd subitem to Item 2 of this menu */
  33. sub=AddSub(item,'SubItem 3',,,,,wind)
  34. IF sub == '' | sub == 0 THEN Text('Menu error',wind,5,12)
  35. /* Add the 3rd item to menu 2. Let's have this one's flags be CHECKIT (1) and MENUTOGGLE (8) */
  36. /* Note how the menu has a checkmark which toggles each time it is selected */
  37. item=AddItem(menu,'Item 3',1+8,,,,wind)
  38. IF item == '' | item == 0 THEN Text('Menu error',wind,5,12)
  39.  
  40. /* Change to JAM2 for printing out the IDCMPspec */
  41. err = SetDraw(wind,3,,1)
  42.  
  43. /* Loop until CLOSEWINDOW class (0), printing out all IDCMPspecs in the upper */
  44. /* left corner. Note that the Quit Item will return a MENUPICK and then a CLOSEWINDOW. */
  45. /* Observe the printout as you select and use gadgets and click the mouse. */
  46. /* Start out CLASS = 1 before we get into the loop. */
  47. class = 1
  48. DO WHILE class > 0
  49. spec=WaitMsg(wind)
  50. PARSE var spec class part1 part2 part3
  51. err=Erase(30,wind,5,20)
  52. err=Text(spec,wind,5,20)
  53. END
  54.  
  55. err=EndWindow(wind)
  56.