Bonjour tout le monde,
je rencontre un petit problème de compréhension sur le Widget ComboBox (en fait j'ai deux problème).
Quand j'initialise les différentes possibilité de ma combo box et que je souhaite afficher l'élément 1 (le premier ajouté) par défaut, sur mon application j'ai l'élément 2 comme actif à l'ouverture.Code:Le premier :
Voici le code :
Si je comprend bien le fonctionnement, dans ma liste déroulante, je devrais avoir "rijndael-128" par défaut hors j'ai "cast-128".Code:
1
2
3
4
5
6
7
8
9
10
11
12 GtkWidget *pComboBoxAlgo; pComboBoxAlgo = gtk_combo_box_new_text(); gtk_table_attach(GTK_TABLE(pTable), pComboBoxAlgo, 1, 3, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND, 3, 5); gtk_combo_box_append_text(GTK_COMBO_BOX(pComboBoxAlgo), "rijndael-128"); gtk_combo_box_append_text(GTK_COMBO_BOX(pComboBoxAlgo), "cast-128"); gtk_combo_box_append_text(GTK_COMBO_BOX(pComboBoxAlgo), "gost"); gtk_combo_box_append_text(GTK_COMBO_BOX(pComboBoxAlgo), "twofish"); gtk_combo_box_append_text(GTK_COMBO_BOX(pComboBoxAlgo), "arcfour"); gtk_combo_box_set_active(GTK_COMBO_BOX(pComboBoxAlgo), 0);
Le deuxième :
Comment peut on faire activer une action sur le changement de l'élément actif?
ex : pour un bouton, nous avons :
je ne trouve pas d'aide sur l'équivalent pour les combobox ...Code:g_signal_connect(G_OBJECT(pChekButtComp), "clicked", G_CALLBACK(choix_compression), NULL);
Merci d'avance.