begin external class windowtools="wt"; inspect new BasicWindow ("A moi") do begin Ref(button) B1,B2,B; integer n,X,Y; procedure TreatEvt; begin if ButtonPressed(B) then outtext("Button " & B.heading & ", "); if Clicked(X,Y) then Begin outtext("Click a <"); outint(X,0); outchar('-'); outint(Y,0); outtext(">, "); end; if Timeout then begin outtext("Clock = "); outint(clocktime,0); end; Outimage; end; B1 :- makeButton("B1"); B2 :- MakeButton("B2"); Message("Test d'evenements. On accepte ALARM, CLICK & BOUTONS"); setAlarm(1); setAlarm(2); setalarm(6); Outline("Alarm, Click & Boutons"); for n:= 1 step 1 until 5 do begin waitfor(alarmEvt+buttonEvt+clickEvt); TreatEvt; end; outimage; Message("ALARM & BOUTONS, pas les Clicks"); Outline("Alarm, Boutons"); setAlarm(1); setalarm(5); for n:= 1 step 1 until 5 do begin waitfor(alarmEvt+buttonEvt); TreatEvt; end; outimage; Message("ALARM & CLICK, pas les boutons"); Outline("Alarm, Click"); setAlarm(1); setalarm(5); for n:= 1 step 1 until 5 do begin waitfor(alarmEvt+clickEvt); TreatEvt; end; outimage; Message("BOUTONS & CLICK, pas les alarmes"); Outline("Boutons, Click"); setAlarm(1); setalarm(5); for n:= 1 step 1 until 5 do begin waitfor(buttonEvt+clickEvt); TreatEvt; end; outimage; TimedMessage("Now we wait for CLICK only",2); waitforClick(X,Y); Outline("Got Click"); TimedMessage("Now we wait for Timer only",2); setAlarm(4); waitforAlarm; Outline("Got Alarm"); TimedMessage("Now press a button to exit",2); outLine("Got " & ButtonChoice); end; end