home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
dirs
/
rexxintuition_463.lzh
/
RexxIntuition
/
Menus.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-03-09
|
2KB
|
56 lines
/* 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 (4) flag and specify 'Q' */
/* Also, I've set this item up to issue a CLOSEWINDOW with OK state */
item=AddItem(menu,'Quit',4,,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. Make this HIGHBOX */
sub=AddSub(item,'SubItem 1',128,,,,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 (1) and MENUTOGGLE (8) */
/* Note how the menu has a checkmark which toggles each time it is selected */
item=AddItem(menu,'Item 3',1+8,,,,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)