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
|
typedef struct variableSimulation {
GtkWidget *SimuWindow;
GtkWidget *SimuTable;
GtkWidget *SimuButton[5];
GtkWidget *SimuLabel[29];
GtkWidget *sEntry[5];
}variableSimulation;
void affiche_production (GtkWidget *widget, sgpointer *variableS);
int main( int argc, char **argv)
{
variableSimulation* variableS;
variableS=malloc(sizeof(variableSimulation));
gtk_init(&argc,&argv);
//fonction qui créer une fenetre et qui affiche les 5 entrées
g_signal_connect(G_OBJECT(variableS->SimuButton[4]),"clicked", G_CALLBACK(affiche_production), (gpointer) variableS);
gtk_main();
void affiche_production (GtkWidget *widget, gpointer *variableS)
{
const gchar *sText;
int i;
for(i=0;i<5;i++)
{
sText = gtk_entry_get_text(GTK_ENTRY(variableS->sEntry[i]));
printf("%s\n",sText);
}
} |
Partager