Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Fenetre.h"
- #include "Souris.h"
- #include "CaseACocher.h"
- int main (int argc, char **argv){
- gtk_init(&argc, &argv);
- Fenetre f ("La fenetre",1000,1000);
- Souris s (f);
- CaseACocher cac;
- Couleur rouge, vert;
- int posX, posY, etatSouris;
- Carre leCarre;
- etatSouris=0;
- rouge.definir(255,0,0);
- vert.definir(0,255,0);
- cac.definirCadre(450,450,50,rouge);
- cac.definirEtat('N');
- leCarre = cac.cadre();
- cac.afficher(f);
- while (etatSouris != 2)
- {
- if (s.testeBoutons(posX, posY, etatSouris))
- {
- if (etatSouris == 1 and leCarre.touche(posX,posY))
- {
- cac.effacer(f);
- if (cac.etat() == 'N')
- {
- cac.definirCouleur(vert);
- cac.definirEtat('C');
- }
- else
- {
- cac.definirEtat('N');
- cac.definirCouleur(rouge);
- }
- cac.afficher(f);
- }
- }
- }
- f.disparait();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement