//-------------------- //A:Définitions //-------------------- #ifdef __GNUC__ #include #endif //--------------------------- //B:Votre code //--------------------------- static int debut() { RectangleType r; r.topLeft.x=80; r.topLeft.y=20; r.extent.x=5; r.extent.y=5; char* mot="Bonjour !"; char texte[80]; int n; n = 1234; StrPrintF(texte,"n = %i",2*n); WinDrawChars (mot, StrLen(mot),10,10); WinDrawChars(texte,StrLen(texte),10,30); WinDrawRectangle (&r,0); WinDrawLine(0, 50, 200, 50); return 0; } //---------------------- //C:Boucle évènementielle //---------------------- static void boucle() { EventType evt; do { EvtGetEvent(&evt, evtWaitForever); if (!SysHandleEvent(&evt)) FrmDispatchEvent(&evt); } while (evt.eType!=appStopEvent); } //-------------------- //D:Procédure principale //--------------------- UInt32 PilotMain(UInt16 launchCode, void *cmdPBP, UInt16 launchFlags) { if (launchCode==sysAppLaunchCmdNormalLaunch) {if (debut() ==0) boucle();} return 1; }