Bonjour,
Je suis entrain de developper un projet en ce moment, avec l'interface gtk+.
Le programme se compile sans probleme, mais lors de l'éxécution, j'ai ce message:
Je ne compreds pas du tout d'où cela peut venir
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 The program 'Bison_Calculatrice' received an X Window System error. This probably reflects a bug in the program. The error was 'BadDrawable (invalid Pixmap or Window parameter)'. (Details: serial 6635 error_code 9 request_code 53 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.)
Voici mon code au cas où...
Le probleme survient quand j'appele la fonction "parser"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 void calculer(GtkWidget *widget, gpointer data) { /* Variables */ const gchar *sSaisie = NULL; char *code = NULL; /* Récuperation du GtkEntry */ sSaisie = gtk_entry_get_text(GTK_ENTRY(data)); code = (char*) sSaisie; /* Le programme m'affiche le message, quand j'appelle cette fonction */ parser(code); }
voici la fonction en question:
Le plus bizarre, c'est que j'ai essayé cette fonction dans un programme tout bete, avec juste un main, et un scanf, et je n'avais pas de probleme
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 int parser(char *calcul) { /* Creation du pipe */ int pfd[2]; if (pipe(pfd) == -1) { printf("pipe failed\n"); return 1; } /* Creation du processus enfant */ int pid; if ((pid = fork()) < 0) { printf("fork failed\n"); return 2; } if (pid == 0) { /* Processus Enfant */ close(pfd[1]); /* Fermeture du cote ecriture non utile */ dup2(pfd[0], 0); /* Connexion du cote lecture avec stdin */ close(pfd[0]); /* Fermeture du cote lecture */ /* Appel du parser */ yyparse(); return 3; } else { /* Processus pere */ close(pfd[0]); /* Fermeture du cote lecture non utile */ dup2(pfd[1], 1); /* Connexion du cote ecriture avec stdout */ close(pfd[1]); /* Fermeture du cote ecriture */ printf("%s\n", calcul); return 4; } }
Donc, ben si vous avez une idée, bienvenue
Merci
Partager