Hi

I have tried to add a GUI to my program and it works so far. Only problem I now 
have is that if I enter an ill formatted value and click on the generate 
button, the exception handling part is going into an endless loop. 

I suppose it is because the values are not consumed from the fields.

How do I solve this problem?

I have removed the uninteresting garbage so it is not complete.

Thanks

Laurent 

procedure Generateur_Trame_VT2_GUI is
   
   Matricule_Form                : Gnoga.Gui.Element.Form.Form_Type;
   Input_Matricule               : Gnoga.Gui.Element.Form.Text_Type;
   Matricule_Label               : Gnoga.Gui.Element.Form.Label_Type;

   --------------
   -- Generate --
   --------------

   procedure On_Generate (Object : in out Gnoga.Gui.Base.Base_Type'Class) is

      Test_Matricule : Matricules.Object;

   begin -- On_Generate

      Valid_Matricule : loop

         Handle_Matricule_Error : declare

         begin -- Handle_Matricule_Error
            Test_Matricule := Matricules.Make (Input_Matricule.Value);

            exit Valid_Matricule;

         exception -- Handle_Matricule_Error
            when Constraint_Error =>
               Main_View.New_Line;
               Main_View.Put_Line ("Format de matricule invalide, veuillez 
reessayer svp!");
         end Handle_Matricule_Error;
      end loop Valid_Matricule;

   end On_Generate;

begin -- Generateur_Trame_VT2_GUI

   Matricule_Form.Create (Main_View);
   Input_Matricule.Create (Matricule_Form, 40);
   Matricule_Label.Create (Matricule_Form, Input_Matricule,
                           "Veuillez introduire la matricule: ");
   
end Generateur_Trame_VT2_GUI;  



------------------------------------------------------------------------------
_______________________________________________
Gnoga-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to