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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <gsl_statistics_double.h>
#include <gsl_statistics.h>
#include <stdlib.h>
#include <gtk/gtk.h>
void aquisition (GtkWidget *wid, GtkWidget *win)
{
int X=5;
if( X>=1)
{
/// Mesures 1 ///
/* Creation du premier GtkFrame */
pFrame1 = gtk_frame_new("Mesure 1");
gtk_box_pack_start(GTK_BOX(pVBox), pFrame1, TRUE, FALSE, 0);
/* Creation et insertion d une boite pour le premier GtkFrame */
pVBoxFrame = gtk_vbox_new(TRUE, 0);
gtk_container_add(GTK_CONTAINER(pFrame1), pVBoxFrame);
/* Creation et insertion des elements contenus dans le premier GtkFrame */
pLabel = gtk_label_new("X1 :");
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
/* Creation d un GtkHSeparator */
pSeparator = gtk_hseparator_new();
/* Prénom */
pLabel = gtk_label_new("Y1 :");
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
/* Creation d un GtkHSeparator */
pSeparator = gtk_hseparator_new();
}
if( X>=2)
{
/// Mesures 2 ///
/* Creation du premier GtkFrame */
pFrame2 = gtk_frame_new("Mesure 2");
gtk_box_pack_start(GTK_BOX(pVBox), pFrame2, TRUE, FALSE, 0);
/* Creation et insertion d une boite pour le premier GtkFrame */
pVBoxFrame = gtk_vbox_new(TRUE, 0);
gtk_container_add(GTK_CONTAINER(pFrame2), pVBoxFrame);
pLabel = gtk_label_new("X2 :");
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
/* Creation d un GtkHSeparator */
pSeparator = gtk_hseparator_new();
/* Prénom */
pLabel = gtk_label_new("Y2 :");
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
/* Creation d un GtkHSeparator */
pSeparator = gtk_hseparator_new();
}
if( X>=3)
{
/// Mesures 3 ///
/* Creation du premier GtkFrame */
pFrame3 = gtk_frame_new("Mesure 3");
gtk_box_pack_start(GTK_BOX(pVBox), pFrame3, TRUE, FALSE, 0);
/* Creation et insertion d une boite pour le premier GtkFrame */
pVBoxFrame = gtk_vbox_new(TRUE, 0);
gtk_container_add(GTK_CONTAINER(pFrame3), pVBoxFrame);
pLabel = gtk_label_new("X3 :");
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
/* Creation d un GtkHSeparator */
pSeparator = gtk_hseparator_new();
/* Prénom */
pLabel = gtk_label_new("Y3 :");
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0);
pEntry = gtk_entry_new();
/* Creation d un GtkHSeparator */
pSeparator = gtk_hseparator_new();
/// Insertion des box///
if( X>=1)
{
gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame1,0, 1, 1, 2);
}
if( X>=2)
{
gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame2,1, 2, 1, 2);
}
if( X>=3)
{
gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame3,2, 3, 1, 2);
}
}
/*Affichage du contenu*/
gtk_widget_show_all(pWindow);
gtk_main();
} |
Partager