slt j’ai ecrit une fonction qui prend 2 valeur numerique (avec 2 Scrollbar) et effectue un traitement avec ,mais j’ai rencontré 2 probleme :
1- comment on fait pour recuperer la valeur des 2 scrollbar lrsq j’appuye sur le bouton « valider » ?
2- Je transmet la valeur comment a une autre fonction ?
3- est ce quelqu'un peut m'expliquer svp cmt on utilise le g_signal_connect correctement svp ?
merci
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
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
void verification_section(GtkWidget*Awindow ,gpointer data )
{
    GtkWidget *window=NULL,*boite=NULL,*alert=NULL;
    GtkWidget *champ=NULL,*panier_selection=NULL;
    GtkWidget *bouton[3],*select_code=NULL,*select_section=NULL,*titre_code=NULL,*titre_section=NULL;
    gint reponse,min_code,max_code;
    gint code_produit,*code_section=NULL;
 
    const gchar *text_1,*text_2;
    gpointer *b;
    GtkWidget *a;
 
    min_code=code_plus_petit(l_a);//fct sans importance juste pour determiner 
    //les limites du scrollbar
    max_code=code_plus_grand(l_a);
      if (min_code==-1) //si fichier vide a amerliorer
    {
    alert=gtk_message_dialog_new (NULL,GTK_DIALOG_MODAL ,GTK_MESSAGE_ERROR
    ,GTK_BUTTONS_OK,"Fichiers non charges!");
 
 
    reponse=gtk_dialog_run(GTK_DIALOG(alert));
    gtk_widget_destroy(alert);
    charger_les_fichiers(a,b);//charge le contenu des fichiers on peut s'en passer
 
 
 
    }
 
 
 
    else
    {
            //creation de la fentre
   window=gtk_dialog_new_with_buttons("verification de la section", NULL
    ,GTK_DIALOG_MODAL,GTK_STOCK_OK,GTK_RESPONSE_OK,
        GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL,
        NULL);
 
 
 
 
    panier_selection=gtk_vbox_new(TRUE,5);
    select_code=gtk_spin_button_new_with_range (min_code,max_code,1);
    min_code=code_section_plus_petit(l_s);
    max_code=code_section_plus_grand(l_s);
    select_section=gtk_spin_button_new_with_range (min_code,max_code,1);
    titre_code=gtk_frame_new("selectionner un code produit" );
    titre_section=gtk_frame_new("selectionner un code section" );
 
    code_produit=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(select_code));
    gtk_container_add(GTK_CONTAINER(titre_code), select_code);
    gtk_container_add(GTK_CONTAINER(titre_section), select_section);
 
    gtk_box_pack_start(GTK_BOX(panier_selection),titre_code,FALSE,FALSE,0);
    gtk_box_pack_start(GTK_BOX(panier_selection),titre_section,FALSE,FALSE,0);
 
 
    code_section=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(select_code));
 
    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox), panier_selection, TRUE, FALSE, 0);
 
    gtk_widget_show_all(GTK_DIALOG(window)->vbox);
 
 
 
     reponse=gtk_dialog_run(GTK_DIALOG(window));
 
    code_produit= gtk_range_get_value(GTK_RANGE(titre_code));
 
    if (reponse==GTK_RESPONSE_OK)
    {
        puts("c ok!");
 
 
    }
    else
    {
         puts("annule par l'utilisateur");
    }
    printf("%d",code_produit);//il m'affiche tjrs 0
 
gtk_widget_destroy(window);
 
    }
 
 
 
}