
                      /* Listato 8 */

                 /* Generazione Alert */


#include <grafica.h>

 main()
 {
  int t; /* Valore di ritorno */

  AttivaG(); /* Apre le librerie */

  t=Alert(RECOVERY_ALERT,50,"      Premi uno dei tasti del mouse...",100);

  if (t==1) printf("Tasto sinistro\n");
  if (t==0) printf("Tasto destro\n");

  Delay(200);

  EndG();

 } /* FINE */


int Alert(tipo,y,t,s)
UBYTE tipo,y;
UBYTE t[];
UWORD s;
{
 UBYTE c[2000]; /* Spazio per il messaggio: max 2K */
 int i;

 c[0]=0; /* x=0 y=y */
 c[1]=0;
 c[2]=y;

  i=0;
  while((c[i+3]=t[i])!=NULL) i++; /* Copia t in c */


 return(DisplayAlert(tipo,c,s)); /* ALERT */

}
