home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 18
/
aminetcdnumber181997.iso
/
Aminet
/
dev
/
e
/
EasyGUI_v33b2.lha
/
Src
/
EasyGUI
/
testaw.e
< prev
next >
Wrap
Text File
|
1997-02-10
|
2KB
|
57 lines
-> testaw.e - shows use of AppWindow handling and changing GUIs
MODULE 'tools/easygui',
'workbench/startup', 'workbench/workbench'
CONST MAXLEN=20
DEF current=0, gui:PTR TO LONG
PROC main()
DEF s[MAXLEN]:STRING
-> Have a list of three different GUIs
gui:=[
[LISTV,{ignore},'Drop Icons on Me!',15,7,NIL,0,1,0,0,0,{gadappw}],
[ROWS,[STR,{ignore},'Drop Icons on Me:',s,MAXLEN,5,0,0,0,{gadappw}],
[SPACEV],[BUTTON,{ignore},'But Not on Me']],
[ROWS,[BUTTON,{ignore},'Drop Icons on Me:',0,0,{gadappw}],
[SPACEV],[STR,{ignore},'Not on Me:',s,MAXLEN,5]]
]
easyguiA('Test App Window', gui[current],
[EG_AWPROC,{winappw}, NIL])
ENDPROC
-> Ignore button presses etc.
PROC ignore(info,num) IS EMPTY
-> Show next GUI in list
PROC nextgui(gh)
current++
IF current>=ListLen(gui) THEN current:=0
changegui(gh, gui[current])
ENDPROC
-> Default (window) App message handler
PROC winappw(info,awmsg)
PrintF('You missed the gadget... try again!\n')
ENDPROC
-> App message handler for a gadget
PROC gadappw(info,awmsg)
PrintF('You hit the gadget! ')
showappmsg(awmsg)
nextgui(info)
ENDPROC
-> Show the contents of the App message
PROC showappmsg(amsg:PTR TO appmessage)
DEF i, args:PTR TO wbarg
PrintF('Hit at (\d,\d)\n', amsg.mousex, amsg.mousey)
args:=amsg.arglist
FOR i:=1 TO amsg.numargs
PrintF(' arg(\d): Name="\s", Lock=$\h\n',
i, args.name, args.lock)
args++
ENDFOR
PrintF('\n')
ENDPROC