home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
coders
/
jËzyki_programowania
/
amigae
/
e_v3.2a
/
src
/
guide
/
idcmp.e
< prev
next >
Wrap
Text File
|
1977-12-31
|
848b
|
25 lines
MODULE 'intuition/intuition'
CONST GADGETBUFSIZE = GADGETSIZE, OURGADGET = 1
PROC main()
DEF buf[GADGETBUFSIZE]:ARRAY, wptr, class, gad:PTR TO gadget
Gadget(buf, NIL, OURGADGET, 1, 10, 30, 100, 'Press Me')
wptr:=OpenW(20,50,200,100,
IDCMP_CLOSEWINDOW OR IDCMP_GADGETUP,
WFLG_CLOSEGADGET OR WFLG_ACTIVATE,
'Gadget message window',NIL,1,buf)
IF wptr /* Check to see we opened a window */
WHILE (class:=WaitIMessage(wptr))<>IDCMP_CLOSEWINDOW
gad:=MsgIaddr() /* Our gadget clicked? */
IF (class=IDCMP_GADGETUP) AND (gad.userdata=OURGADGET)
TextF(10,60,
IF gad.flags=0 THEN 'Gadget off ' ELSE 'Gadget on ')
ENDIF
ENDWHILE
CloseW(wptr) /* Close the window */
ELSE
WriteF('Error -- could not open window!')
ENDIF
ENDPROC