Précédent   Forum des professionnels en informatique > Général Développement > Programmation système > Linux > GTK
GTK Vos questions sur GTK sous Linux
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 31/08/2011, 21h11   #1
Membre confirmé
 
Inscription : juin 2006
Messages : 649
Détails du profil
Informations personnelles :
Âge : 42

Informations forums :
Inscription : juin 2006
Messages : 649
Points : 276
Points : 276
Par défaut Mise en premier d'un nouvelle fenêtre avec GtkAda

Bonjour.
J'ai écris un programme qui fonctionne sur Gnu/Linux, mais pas sur Windows.
En effet, à la création de la première fenêtre de dialogue, celle ci ce place derrière la fenêtre principale. Sur Gnu/Linux, pas de problème pour passer d'une fenêtre à l'autre et entrer les données... Mais sur Windows, après le focus sur la nouvelle fenêtre, impossible d'entrer les données, la fenêtre est occuper.

Sauriez vous me dire avec ces information ou est mon erreur ? S'il vous plaît ?
Merci.
jovalise est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/09/2011, 14h25   #2
Membre Expert
 
Homme
Développeur informatique
Inscription : juin 2009
Messages : 840
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Développeur informatique
Secteur : Industrie

Informations forums :
Inscription : juin 2009
Messages : 840
Points : 1 168
Points : 1 168
Sans code ça va être dur de te répondre...
liberforce est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/09/2011, 08h47   #3
Membre confirmé
 
Inscription : juin 2006
Messages : 649
Détails du profil
Informations personnelles :
Âge : 42

Informations forums :
Inscription : juin 2006
Messages : 649
Points : 276
Points : 276
Bonjour, merci, voici les sources qui ne rentrent pas dans une balise code, alors voici un fichier html : warborg-xborg.adb.html à télécherger sur zippyshare.

Vous trouverez ligne 1914 l'appel à Get_Wopr_Attributes qui est la fenêtre occupée incriminée.

Ligne 1442 la procédure initialize de la fenêtre principale.
Ligne 1712 la procédure Get_Wopr_Attributes.

Merci pour vos réponses.
jovalise est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/09/2011, 11h59   #4
Membre Expert
 
Homme
Développeur informatique
Inscription : juin 2009
Messages : 840
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Développeur informatique
Secteur : Industrie

Informations forums :
Inscription : juin 2009
Messages : 840
Points : 1 168
Points : 1 168
Pour poster du code long, utilise un pastebin, du type de pastebin.com.

Bon, je n'y connais rien en Ada, mais tu as l'air de mal utiliser les types de widgets à ta disposition. Tu connectes le signal "clicked" au bouton "OK" de ta fenêtre en ligne 1751. Mais ce n'est pas comme ça qu'on gère une boite de dialogue. On dérive de GtkDialog, on lance gtk_dialog_run, et on teste la valeur de retour.

Je ne suis absolument pas sûr que cela vienne de là bien sûr, je connais GTK, mais pas l'Ada, alors j'ai du mal à lire ton programme.
liberforce est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/09/2011, 13h19   #5
Membre confirmé
 
Inscription : juin 2006
Messages : 649
Détails du profil
Informations personnelles :
Âge : 42

Informations forums :
Inscription : juin 2006
Messages : 649
Points : 276
Points : 276
Ah oui, et peut-on mettre des spin_button dans un Gtk_Dialog ?
jovalise est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/09/2011, 13h28   #6
Membre confirmé
 
Inscription : juin 2006
Messages : 649
Détails du profil
Informations personnelles :
Âge : 42

Informations forums :
Inscription : juin 2006
Messages : 649
Points : 276
Points : 276
Par défaut Pastbin

Bon, je ne sais pas utiliser le pasttbin, je cause pas trop l'english, Voici le lien de pastbin : http://pastebin.com/TJcRSMXg
jovalise est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/09/2011, 13h42   #7
Membre Expert
 
Homme
Développeur informatique
Inscription : juin 2009
Messages : 840
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Développeur informatique
Secteur : Industrie

Informations forums :
Inscription : juin 2009
Messages : 840
Points : 1 168
Points : 1 168
Citation:
Envoyé par jovalise Voir le message
Ah oui, et peut-on mettre des spin_button dans un Gtk_Dialog ?
Bien sûr, c'est une fenêtre tout ce qu'il y a de plus classique, mais orientée intéraction avec l'utilisation (type bouton ok et annuler). Tu peux rajouter ce que tu veux dedans, comme dans les autres fenêtres GTK.
liberforce est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/09/2011, 14h38   #8
Membre confirmé
 
Inscription : juin 2006
Messages : 649
Détails du profil
Informations personnelles :
Âge : 42

Informations forums :
Inscription : juin 2006
Messages : 649
Points : 276
Points : 276
Entendu, merci, je vais voir si ça change quoi que ce soit.

Enfin, dans l'état, le programme fonctionne sur Gnu/Linux et pas sur Windows.
jovalise est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/09/2011, 16h32   #9
Membre confirmé
 
Inscription : juin 2006
Messages : 649
Détails du profil
Informations personnelles :
Âge : 42

Informations forums :
Inscription : juin 2006
Messages : 649
Points : 276
Points : 276
Par défaut erreur à l'exécution d'un gtk-dialog

Bonjour, je reviens avec une erreur à l'exécution du run d'un gtk-dialog.

L'erreur est la suivante :
Citation:
** GLib:ERROR/build/buildd-glib2.0_2.16.6-1+lenny1-i386-HI4TzI/glib2.0-2.16.6/glib/gmain.c:2015):g_main_dispatch: assertion failed: (current->source == &current_source_link)
Voici mon code de procédure qui est appelé extérieurement à la fenêtre.
Code :
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
procedure Get_Wopr_Attributes(Main_Window : Main_Window_access) is
      Vbox      : Gtk_Vbox;
      Ok        : Gtk.Widget.Gtk_Widget;
      cancel    : Gtk.Widget.Gtk_Widget;
   begin
      Gtk_New(Main_Window.Wopr_Window.Dialog, "Get Wopr coordonates", Main_Window.Main_window, Gtk.dialog.modal);
      Ok := Gtk.Dialog.Add_Button(Main_Window.Wopr_Window.Dialog, "Ok", Gtk.Dialog.Gtk_Response_Ok);
      Cancel := Gtk.Dialog.Add_Button(Main_Window.Wopr_Window.Dialog, "Cancel", Gtk.Dialog.Gtk_Response_Cancel);
      Vbox := Get_Vbox(Main_Window.Wopr_Window.Dialog);
      Set_Position(Main_Window.Wopr_Window.dialog, Win_Pos_Center);
      Gtk_New(Main_Window.Wopr_Window.Degr_Lat, -90.0, 90.0, 1.0);
      Gtk_New(Main_Window.Wopr_Window.Minu_Lat, 0.0, 60.0, 1.0);
      Gtk_New(Main_Window.Wopr_Window.Seco_Lat, 0.0, 60.0, 1.0);
      Gtk_New(Main_Window.Wopr_Window.Degr_Lon, -180.0, 180.0, 1.0);
      Gtk_New(Main_Window.Wopr_Window.Minu_Lon, 0.0, 60.0, 1.0);
      Gtk_New(Main_Window.Wopr_Window.Seco_Lon, 0.0, 60.0, 1.0);
      Gtk_New_Hbox(Main_Window.Wopr_Window.Lat_Hbox);
      Gtk_New_Hbox(Main_Window.Wopr_Window.Lon_Hbox);
      Gtk_New(Main_Window.Wopr_Window.Lat_Label, "Latitude  :");
      Gtk_New(Main_Window.Wopr_Window.Lon_Label, "Longitude :");
      Gtk_New_Hbox(Main_Window.Wopr_Window.Lat_Hbox);
      Gtk_New_Hbox(Main_Window.Wopr_Window.Lon_Hbox);
      Pack_Start(Main_Window.Wopr_Window.Lat_Hbox, Main_Window.Wopr_Window.Lat_Label);
      Pack_Start(Main_Window.Wopr_Window.Lat_Hbox, Main_Window.Wopr_Window.Degr_lat);
      Pack_Start(Main_Window.Wopr_Window.Lat_Hbox, Main_Window.Wopr_Window.Minu_lat);
      Pack_Start(Main_Window.Wopr_Window.Lat_Hbox, Main_Window.Wopr_Window.Seco_lat);
      Pack_Start(Main_Window.Wopr_Window.Lon_Hbox, Main_Window.Wopr_Window.Lon_Label);
      Pack_Start(Main_Window.Wopr_Window.Lon_Hbox, Main_Window.Wopr_Window.Degr_Lon);
      Pack_Start(Main_Window.Wopr_Window.Lon_Hbox, Main_Window.Wopr_Window.Minu_Lon);
      Pack_Start(Main_Window.Wopr_Window.Lon_Hbox, Main_Window.Wopr_Window.Seco_Lon);
 
      Pack_Start(Vbox, Main_Window.Wopr_Window.Lat_Hbox);
      Pack_Start(Vbox, Main_Window.Wopr_Window.Lon_Hbox);
      Text_Io.Put_Line("Packstart Ok ! ");
      Show_All(Main_Window.Wopr_Window.Dialog);
      Text_Io.Put_Line("Show_all Ok ! ");
      case Gtk.Dialog.Run(Main_Window.Wopr_Window.Dialog) is
         when Gtk.Dialog.Gtk_Response_Ok    =>
            Create_Wopr(null, Main_Window);
            Gtk.Dialog.Destroy(Main_Window.Wopr_Window.Dialog);
         when Gtk.Dialog.Gtk_Response_Cancel =>
            Gtk.Dialog.Destroy(Main_Window.Wopr_Window.Dialog);
         when others =>
            Gtk.Dialog.Destroy(Main_Window.Wopr_Window.Dialog);
      end case;
   end Get_Wopr_Attributes;
Merci pour vos lumières.
jovalise est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/09/2011, 12h15   #10
Membre confirmé
 
Inscription : juin 2006
Messages : 649
Détails du profil
Informations personnelles :
Âge : 42

Informations forums :
Inscription : juin 2006
Messages : 649
Points : 276
Points : 276
Merci bien pour la méthode liberforce, le programme fonctionne sur Windows à présent, et fonctionne même mieux sur Gnu/Linux.
jovalise est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 21h50.


 
 
 
 
Partenaires

Hébergement Web