/* An example of using the dissidents rx_intui.library */ wind=GetWindow('Try Menus',,,,,,,,,) IF wind == '' | wind == 0 THEN SAY 'Window open error' /* Add first menu */ menu=AddMenu(wind,'Project',0,90) IF menu == '' | menu == 0 THEN Text('Menu error',wind,5,12) /* Add the first item to menu 1 */ item=AddItem(menu,'Load',,,,,wind) IF item == '' | item == 0 THEN Text('Menu error',wind,5,12) /* Add a second item to menu 1. Note that I set COMMSEQ (2) flag and specify 'Q' */ /* Also, I've set this item up to issue a CLOSEWINDOW with OK state */ item=AddItem(menu,'Quit','2',,128+1,'Q',wind) IF item == '' | item == 0 THEN Text('Menu error',wind,5,12) /* Add the second menu */ menu=AddMenu(wind,'Menu 2',100,90) IF menu == '' | menu == 0 THEN Text('Menu error',wind,5,12) /* Add the first item to menu 2 */ item=AddItem(menu,'Item 1',,,,,wind) IF item == '' | item == 0 THEN Text('Menu error',wind,5,12) /* Add the second item to menu 2 */ item=AddItem(menu,'Item 2',,,,,wind) IF item == '' | item == 0 THEN Text('Menu error',wind,5,12) /* Add 1st subitem to Item 2 of this menu */ sub=AddSub(item,'SubItem 1',,,,,wind) IF sub == '' | sub == 0 THEN Text('Menu error',wind,5,12) /* Add 2nd subitem to Item 2 of this menu */ sub=AddSub(item,'SubItem 2',,,,,wind) IF sub == '' | sub == 0 THEN Text('Menu error',wind,5,12) /* Add 3rd subitem to Item 2 of this menu */ sub=AddSub(item,'SubItem 3',,,,,wind) IF sub == '' | sub == 0 THEN Text('Menu error',wind,5,12) /* Add the 3rd item to menu 2. Let's have this one's flags be CHECKIT (0) and MENUTOGGLE (3) */ /* Note how the menu has a checkmark which toggles each time it is selected */ item=AddItem(menu,'Item 3','03',,,,wind) IF item == '' | item == 0 THEN Text('Menu error',wind,5,12) /* Change to JAM2 for printing out the IDCMPspec */ err = SetDraw(wind,3,,1) /* Loop until CLOSEWINDOW class (0), printing out all IDCMPspecs in the upper */ /* left corner. Note that the Quit Item will return a MENUPICK and then a CLOSEWINDOW. */ /* Observe the printout as you select and use gadgets and click the mouse. */ /* Start out CLASS = 1 before we get into the loop. */ class = 1 DO WHILE class > 0 spec=WaitMsg(wind) PARSE var spec class part1 part2 part3 err=Erase(30,wind,5,20) err=Text(spec,wind,5,20) END err=EndWindow(wind)