int main(void)
{
        int wid,rowtv,coltv,info;
        int status;
	short	type;

	while (TRUE)
	    {
	    status = window_intype(&wid,&type,&rowtv,&coltv,&info);	
	    switch (type)
		{
		case INTINI:			
		    	/* initialization interrupt (event) */
		    pgm_ini();
		    break;
		case INTTRM:			
		        /* termination interrupt (event) */
		    pgm_trm();
		    break;
		case INTKBD:			
			/* keyboard/user interrupt (event) */
		    tvtk_update(tvtk_Tk(),type);
		    break;
		case INTPER:
			/* periodic interrupt (event) (~15 Hz) */
		    tvtk_update(tvtk_Tk(),type);
		    break;
		default:
			/* other interrupts (events) */
		    break;
		}
	    }

}