Well, StormC is like any other C, so every example should work. I don't have my Storm C installation here at work, so I cannot verify now if there are some specialties to attend.
Here is an example that works great with Dice C and VBCC. From my experience there should be no difficulty with Storm C.
#include
#include
#include
int main (int argc,char **argv)
{
BOOL cont;
struct Window *win;
struct RastPort *rp;
struct MsgPort *port;
struct IntuiMessage *mess;
if (win = OpenWindowTags (NULL,
WA_Left,20,WA_Top,10,
WA_Width,200,WA_Height,50,
WA_Title,"My Window",
WA_Flags,WFLG_CLOSEGADGET|WFLG_DRAGBAR|WFLG_DEPTHGADGET|WFLG_ACTIVATE|WFLG_GIMMEZEROZERO,
WA_IDCMP,IDCMP_CLOSEWINDOW|IDCMP_VANILLAKEY,
TAG_END))
{
port = win->UserPort;
rp = win->RPort;
SetDrMd (rp,JAM2);
SetAPen (rp,1);
SetBPen (rp,2);
Move (rp,10,20);
Text (rp,"Close me !",10);
cont = TRUE;
while (cont)
{
WaitPort (port);
while (mess = (struct IntuiMessage *) GetMsg (port))
{
switch (mess->Class)
{
case IDCMP_CLOSEWINDOW:
cont = FALSE;
break;
case IDCMP_VANILLAKEY:
if (mess->Code == 0x1b) /* Esc */
cont = FALSE;
break;
}
ReplyMsg ((struct Message *)mess);
}
}
CloseWindow (win);
}
return (0);
}
Bye,
Thomas