IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Raspberry Pi Discussion :

Problème de Boucle While GTK + en C / C++ sur Raspberry PI


Sujet :

Raspberry Pi

  1. #1
    Membre confirmé
    Homme Profil pro
    Electricien
    Inscrit en
    Juillet 2013
    Messages
    71
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Aisne (Picardie)

    Informations professionnelles :
    Activité : Electricien
    Secteur : Bâtiment

    Informations forums :
    Inscription : Juillet 2013
    Messages : 71
    Par défaut Problème de Boucle While GTK + en C / C++ sur Raspberry PI
    Bonjour à tous,

    pouvez vous me dire pourquoi cette boucle ne m'affiche pas le dernier caractère de la ligne 14 SVP je ne comprend pas ou est l'erreur dans mon code.

    Je vous met la photos du resultat en PJ.

    Code C : 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
     
     
    while(i<24){
     
     
     
              tab_label[i][0] = gtk_label_new_with_mnemonic ("H");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][0], i, 0, 1, 1);        
     
            tab_label[i][1] = gtk_label_new_with_mnemonic ("P");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][1], i, 1, 1, 1);
     
            tab_label[i][2] = gtk_label_new_with_mnemonic ("M");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][2], i, 2, 1, 1);
     
             tab_label[i][3] = gtk_label_new_with_mnemonic ("N");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][3], i, 3, 1, 1);        
     
             tab_label[i][4] = gtk_label_new_with_mnemonic ("O");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][4], i, 4, 1, 1);
     
            tab_label[i][5] = gtk_label_new_with_mnemonic ("A");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][5], i, 5, 1, 1);
     
            tab_label[i][6] = gtk_label_new_with_mnemonic ("B");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][6], i, 6, 1, 1);
     
            tab_label[i][7] = gtk_label_new_with_mnemonic ("C");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][7], i, 7, 1, 1);
     
            tab_label[i][8] = gtk_label_new_with_mnemonic ("D");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][8], i, 8, 1, 1);        
     
            tab_label[i][9] = gtk_label_new_with_mnemonic ("E");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][9], i, 9, 1, 1);    
     
            tab_label[i][10] = gtk_label_new_with_mnemonic ("F");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][10], i, 10, 1, 1);       
     
            tab_label[i][11] = gtk_label_new_with_mnemonic ("G");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][11], i, 11, 1, 1);       
     
            tab_label[i][12] = gtk_label_new_with_mnemonic ("H");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][12], i, 12, 1, 1);
     
            tab_label[i][13] = gtk_label_new_with_mnemonic ("I");  
            gtk_grid_attach (GTK_GRID (grid), tab_label[i][13], i, 13, 1, 1);
     
     
            i++;
    Nom : resultat.jpg
Affichages : 35
Taille : 341,4 Ko


    Merci pour vos retour

    Cordialement

    Oscar

  2. #2
    Membre confirmé
    Homme Profil pro
    Electricien
    Inscrit en
    Juillet 2013
    Messages
    71
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Aisne (Picardie)

    Informations professionnelles :
    Activité : Electricien
    Secteur : Bâtiment

    Informations forums :
    Inscription : Juillet 2013
    Messages : 71
    Par défaut
    Bonjour, bon désolé,

    je viens de trouver l'erreur. elle vien de la déclaration de GtkWidget *tab_label

    GtkWidget *tab_label[24][13];

    j'ai changé 13 par 14 et tout est rentrée dans l'ordre.
    GtkWidget *tab_label[24][14];

    Cordialement

    Oscar

  3. #3
    Responsable Arduino et Systèmes Embarqués


    Avatar de f-leb
    Homme Profil pro
    Enseignant
    Inscrit en
    Janvier 2009
    Messages
    13 027
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Sarthe (Pays de la Loire)

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Janvier 2009
    Messages : 13 027
    Billets dans le blog
    47
    Par défaut
    Bonjour,

    Il y a surement moyen d'optimiser le code avec un nouveau tableau et une boucle imbriquée :

    Code C : Sélectionner tout - Visualiser dans une fenêtre à part
    char labels[] = {'H', 'P', 'M', 'N', 'O', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'};

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. boucle while trop lente
    Par atouze dans le forum Access
    Réponses: 17
    Dernier message: 15/06/2005, 17h35
  2. Boucle while & read
    Par gibet_b dans le forum Linux
    Réponses: 4
    Dernier message: 29/04/2005, 16h38
  3. boucle while et post incrémentation
    Par tut dans le forum C++
    Réponses: 7
    Dernier message: 10/12/2004, 18h24
  4. [MFC] Dialog dans une boucle while
    Par oxor3 dans le forum MFC
    Réponses: 5
    Dernier message: 23/04/2004, 23h51
  5. [débutant]Documentation? boucle "while"? Session?
    Par o151181 dans le forum Servlets/JSP
    Réponses: 2
    Dernier message: 19/01/2004, 16h20

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo