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 41 42 43 44 45 46 47 48 49 50 51
|
void Remplire_Table(GtkWidget* widget, gpointer data)
{
GList * pListe = NULL;
int compteur = 0, ok = 0, i = 0;
gchar const * string, *La_donnee[2], *chem_table;
FILE *pt_fichier;
pListe = gtk_container_get_children(GTK_CONTAINER((GtkWidget*)data));
while(pListe)
{
if((gtk_entry_get_text(GTK_ENTRY(pListe->data))) && pListe)
{
La_donnee[i] = gtk_entry_get_text(GTK_ENTRY(pListe->data));
compteur++;
printf("%s\n", La_donnee[i]);
i++;
}
if((chem_table = gtk_label_get_label(GTK_LABEL(pListe->data))) && (ok != 1) && pListe)
{
printf("%s\n", chem_table);
pt_fichier = fopen(chem_table, "a+");
ok = 1;
}
/*Enregistrer les éléments récupérés dans le fichier*/
if(compteur == 3)
{
printf("\n\nEnregistrer dans le fichier les donnees suivantes %s %s %s", La_donnee[0], string, La_donnee[1]);
fprintf(pt_fichier, "%s\n%s\n%s\n", La_donnee[1], string, La_donnee[0]);
g_free(La_donnee);
compteur = 0;
i = 0;
}
/*déplacer la liste vers l'élément suivant*/
pListe = g_list_next(pListe);
/*Récupérer le contenu de la zone liste déroulante*/
if((gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(pListe->data)->entry))) && pListe)
{
string = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(pListe->data)->entry));
printf("%s\n", string);
compteur++;
}
}
fclose(pt_fichier);
} |
Partager