home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
dirs
/
projmot_453.lzh
/
ProjMot
/
src
/
handleidcmpgraph.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-18
|
982b
|
57 lines
/* HandleIDCMP
* ~~~~~~~~~~~
* Handle intuimessage and return an int to be processed
* © Copyright 1991 Christian E. Hopps
*/
#include <intuition/intuition.h>
HandleIDCMP(int window, struct Window *win)
{
int flag;
struct IntuiMessage *msg = NULL;
ULONG class;
struct Gadget *g;
USHORT id;
flag = 9;
if(window)
{
while((msg = (struct IntuiMessage *)GetMsg(win->UserPort)))
{
class = msg->Class;
if(class == GADGETUP)
{
g = (struct Gadget *)msg->IAddress;
id = g->GadgetID;
}
ReplyMsg(msg);
flag = (int)id + 1;
printf("id = %d",id);
}
}
else
{
while((msg = (struct IntuiMessage *)GetMsg(win->UserPort)))
{
class = msg->Class;
ReplyMsg(msg);
switch(class)
{
case NEWSIZE: /* Clear */
flag =(int)5;
break;
case CLOSEWINDOW: /* Angle */
flag =(int)0;
break;
case MOUSEBUTTONS:
flag =(int)2;
break;
default:
flag = (int)1;
break;
}
}
}
return(flag);
}