Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1366 connectés 

  FORUM HardWare.fr
  Programmation
  Ada

  [Ada][Resolu]Editer les propriétés des plug-ins (GtkAda)

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[Ada][Resolu]Editer les propriétés des plug-ins (GtkAda)

n°2256824
par l'anne​au de l'ia
word master
Posté le 28-04-2015 à 20:54:11  profilanswer
 

Bonjour,
 
Je sus amateur en programmation, j'espère que vous me pardonnerez pour mes lacunes.
 
J'écris un compositeur virtuel à base de plug ins. C'est multi plug, c'est à dire qu'on selectionne un ensemble de plug-in qui fonctionne simultanément.
J'ai donc une liste de plug-in dont je souhaiterais éditer les propriétés.
 
Avec Ada j'ai fait ceci :
 
Specification :
 

Code :
  1. with Gtk.Button;
  2. with Gtk.Window;
  3. with Gtk.Box;
  4. with Ada.Finalization;
  5. with System.Address_To_Access_Conversions;
  6. package Ultrason.Mainwin is
  7.  
  8.   type Mainwin_Record;
  9.  
  10.   task type Ultraprocess(Mainwin : access Mainwin_Record) is
  11.      entry Initialize;
  12.      entry Start;
  13.      entry Stop;
  14.      entry Halt;
  15.   end Ultraprocess;
  16.  
  17.  
  18.   type Generator_Type;
  19.  
  20.   task type Gen_Track(Gen : access Generator_Type'Class) is
  21.      entry Start;
  22.      entry Stop;
  23.      entry Halt;
  24.      entry Run;
  25.      entry Suspend;
  26.      entry Quit;
  27.   end Gen_Track;
  28.  
  29.   type Generator_Type is abstract tagged limited
  30.      record
  31.      Track : Gen_Track(Generator_type'Access);    
  32.      end record;
  33.  
  34.   type Generator_Access is access all Generator_Type'Class;
  35.  
  36.   type Tempo_Generator_Type;
  37.  
  38.   task type Tempo_Sync(Gen : access Tempo_Generator_Type'Class) is
  39.   end Tempo_Sync;
  40.  
  41.   type Tempo_Generator_Type is new Generator_Type with
  42.      record
  43.      Tempo : Float := 120.0;
  44.      Sync : Tempo_Sync(Tempo_Generator_Type'access);
  45.      end record;
  46.  
  47.  
  48.   type Voices_2_Generator_Type;
  49.  
  50.   task type Voices_2_Process(Gen : access Voices_2_Generator_Type'Class) is
  51.   end Voices_2_Process;
  52.  
  53.   type Voices_2_Generator_Type is new Generator_Type with
  54.      record
  55.     
  56.      Process : Voices_2_Process(Voices_2_Generator_Type'access);
  57.      end record;
  58.  
  59.  
  60.  
  61.   type Tracks_Type is array (Positive range <> ) of Generator_Access;
  62.  
  63.   type Mainwin_record is new Ada.Finalization.Limited_controlled with
  64.      record
  65.      Window  : Gtk.Window.Gtk_Window;
  66.      Mainbox : Gtk.Box.Gtk_Box;
  67.      Process : Ultraprocess (Mainwin_record'Access);
  68.      Tracks   : Tracks_Type(1..4);
  69.      Start_Button : Gtk.Button.Gtk_Button;
  70.      Stop_Button : Gtk.Button.Gtk_Button;
  71.      Tools_Box   : Gtk.Box.Gtk_Box;    
  72.      end record;
  73.  
  74.   package Ultra_Address_To_Access is new System.Address_To_Access_Conversions(Mainwin_Record);
  75.  
  76.   procedure Initialize (Mainwin : in out Ultra_Address_To_Access.Object_Pointer);
  77.  
  78. end Ultrason.Mainwin;


 
Implémentation :
 

Code :
  1. with Text_Io;
  2. use Text_Io;
  3.  
  4. with Glib;
  5. with Gtk.Scrolled_Window;
  6. with Gtk.Label;
  7. with Gtk.Combo_Box;
  8.  
  9. with Gtk.Dialog;
  10. with Gtk.Main;
  11. with Gtk.Window;
  12. use Gtk.Window;
  13. with Gtk.Handlers;
  14. pragma Elaborate_All(Gtk.Handlers);
  15. with Gtk.Enums;                         use Gtk.Enums;
  16. with Gtk.Widget;                       use Gtk.Widget;
  17. package body Ultrason.Mainwin is
  18.  
  19.  
  20.  
  21.  
  22.  
  23.   package Simple_Window_Cb is new Gtk.Handlers.Callback (Gtk.Widget.Gtk_Widget_Record);
  24.   package Window_Cb is new Gtk.Handlers.User_Callback (Gtk.Widget.Gtk_Widget_Record, Ultra_Address_To_Access.Object_Pointer);
  25.   package Return_Window_Cb is new Gtk.Handlers.User_Return_Callback (Gtk.Widget.Gtk_Widget_Record, Boolean, Ultra_Address_To_Access.Object_Pointer);
  26.  
  27.   procedure Exit_Main (Object : access Gtk.Widget.Gtk_Widget_Record'Class;
  28.             User_Data : Ultra_Address_To_Access.Object_Pointer);
  29.   --  Callbacks when the main window is killed
  30.   function Delete_Event
  31.     (Object : access Gtk_Widget_Record'Class;
  32.      User_Data : Ultra_Address_To_Access.Object_Pointer) return Boolean;      
  33.  
  34.   procedure Start (Object : access Gtk_Widget_Record'Class;
  35.             User_Data : Ultra_Address_To_Access.Object_Pointer) is
  36.      pragma Unreferenced (Object);
  37.   begin
  38.      User_data.all.Process.Start;
  39.   end Start;
  40.  
  41.  
  42.   procedure Stop (Object : access Gtk_Widget_Record'Class;
  43.             User_Data : Ultra_Address_To_Access.Object_Pointer) is
  44.      pragma Unreferenced (Object);
  45.   begin
  46.      User_data.all.Process.Stop;
  47.   end Stop;
  48.  
  49.   procedure Plug_Changed (Object : access Gtk_Widget_Record'Class;
  50.                User_Data : Ultra_Address_To_Access.Object_Pointer) is
  51.      
  52.      Plug_Id : constant Natural := Natural(Gtk.Combo_Box.Get_Active(Gtk.Combo_Box.Gtk_Combo_Box(Object)));
  53.      Plug_Num : Positive := 1;
  54.   begin      
  55.      Plug_Num := Integer'Value(Gtk.Combo_Box.Get_Active_Text(Gtk.Combo_Box.Gtk_Combo_Box(Object))(1..2));      
  56.      case Plug_Id is
  57.      when 0 =>        
  58.         null;
  59.      when 1 =>        
  60.         User_Data.all.Tracks(Plug_Num) := new Tempo_Generator_Type;        
  61.      when 2 =>
  62.         
  63.         User_Data.all.Tracks(Plug_Num) := new Voices_2_Generator_Type;
  64.      when others =>
  65.         null;
  66.      end case;      
  67.      
  68.   end Plug_Changed;
  69.  
  70.  
  71.  
  72.   package Plug_Cb is new Gtk.Handlers.User_Callback (Gtk.Widget.Gtk_Widget_Record, Generator_access);
  73.  
  74.  
  75.  
  76.   procedure Plug_Edit (Object : access Gtk_Widget_Record'Class;
  77.             User_Data : Generator_Access) is
  78.      
  79.   begin
  80.      Text_Io.Put_Line("Plug_edit" );
  81.   end Plug_Edit;
  82.      
  83.  
  84.   -----------------
  85.   --  Exit_Main  --
  86.   -----------------
  87.   use Ultra_Address_To_Access;
  88.   procedure Exit_Main (Object : access Gtk_Widget_Record'Class;
  89.             User_Data : Ultra_Address_To_Access.Object_Pointer) is
  90.      pragma Unreferenced (Object);
  91.   begin
  92.      
  93.      null; -- Finalization;
  94.      User_data.all.Process.Halt;
  95.      Destroy (Object);
  96.      Gtk.Main.Main_Quit;
  97.   end Exit_Main;
  98.  
  99.   ------------------
  100.   -- Delete_Event --
  101.   ------------------
  102.  
  103.   function Delete_Event
  104.     (Object : access Gtk_Widget_Record'Class;
  105.     User_Data : Ultra_Address_To_Access.Object_Pointer) return Boolean
  106.   is
  107.      Dialog : Gtk.Dialog.Gtk_Dialog;
  108.      Yes    : Gtk.Widget.Gtk_Widget;
  109.      No     : Gtk.Widget.Gtk_Widget;
  110.      
  111.      pragma Unreferenced(User_Data);
  112.   begin
  113.      
  114.      loop
  115.         Gtk.Dialog.Gtk_New(Dialog, "Quit ?", Gtk.Window.Gtk_Window(Object), Gtk.dialog.modal);
  116.         Yes := Gtk.Dialog.Add_Button(Dialog, "Yes", Gtk.Dialog.Gtk_Response_Yes);
  117.         No := Gtk.Dialog.Add_Button(Dialog, "No", Gtk.Dialog.Gtk_Response_No);        
  118.         case Gtk.Dialog.Run(Dialog) is
  119.            when Gtk.Dialog.Gtk_Response_Yes    =>              
  120.               Gtk.Dialog.Destroy(Dialog);              
  121.            Gtk.Main.Main_Quit;              
  122.               return False;
  123.            when Gtk.Dialog.Gtk_Response_No     =>
  124.               Gtk.Dialog.Destroy(Dialog);              
  125.               return True;
  126.            when others =>
  127.               Gtk.Dialog.Destroy(Dialog);
  128.         end case;
  129.      end loop;
  130.      return True;
  131.      
  132.   end Delete_Event;
  133.      
  134.   procedure Main_Quit (Action : in System.Address;
  135.             Main_Window : in System.Address);
  136.  
  137.  
  138.  
  139.   pragma Convention (C, Main_Quit);
  140.  
  141.   --  Called when Quit actions has been selected.
  142.  
  143.   procedure Main_Quit (Action : in System.Address;
  144.             Main_Window : in System.Address) is
  145.      
  146.      Dialog : Gtk.Dialog.Gtk_Dialog;
  147.      Yes    : Gtk.Widget.Gtk_Widget;
  148.      No     : Gtk.Widget.Gtk_Widget;
  149.      Window : Gtk.Window.Gtk_Window;
  150.      
  151.   begin
  152.      Window := To_Pointer(Main_Window).all.Window;
  153.      if Window = null then
  154.     
  155.      return;
  156.      end if;
  157.      loop
  158.         Gtk.Dialog.Gtk_New(Dialog, "Quit ?", window, Gtk.dialog.modal);
  159.         Yes := Gtk.Dialog.Add_Button(Dialog, "Yes", Gtk.Dialog.Gtk_Response_Yes);
  160.         No := Gtk.Dialog.Add_Button(Dialog, "No", Gtk.Dialog.Gtk_Response_No);        
  161.         case Gtk.Dialog.Run(Dialog) is
  162.            when Gtk.Dialog.Gtk_Response_Yes    =>
  163.               Gtk.Dialog.Destroy(Dialog);
  164.           
  165.            null; --Os_Finalization;              
  166.            To_Pointer(Main_Window).all.Process.Halt;
  167.           
  168.            Gtk.Main.Main_Quit;
  169.               exit;
  170.            when Gtk.Dialog.Gtk_Response_No     =>
  171.               Gtk.Dialog.Destroy(Dialog);
  172.               exit;
  173.            when others =>
  174.               Gtk.Dialog.Destroy(Dialog);
  175.         end case;
  176.      end loop;
  177.      
  178.   end Main_Quit;        
  179.  
  180.  
  181.   procedure Initialize (Mainwin : in out Ultra_Address_To_Access.Object_Pointer) is
  182.      
  183.      Plug_Box : Gtk.Box.Gtk_Hbox;
  184.      Combo    : Gtk.Combo_Box.Gtk_Combo_Box;
  185.      Button   : Gtk.Button.Gtk_Button;
  186.      Label    : Gtk.Label.Gtk_Label;
  187.      Scrolled : Gtk.Scrolled_Window.Gtk_Scrolled_Window;
  188.      Plug_List: Gtk.Box.Gtk_Vbox;
  189.   begin
  190.      
  191.      
  192.      -- New Object. --
  193.      Mainwin := new Mainwin_Record;  
  194.            
  195.      -- Process ini. --
  196.      Mainwin.Process.Initialize;
  197.      
  198.      
  199.      -- New Window. --
  200.      Gtk.Window.Gtk_New (Mainwin.window);      
  201.      Gtk.Window.Set_Title(Mainwin.window, "Ultrason 2015 MIDI Composer" );
  202.      Gtk.Window.Set_Position(Mainwin.Window, Win_Pos_Center);
  203.      Gtk.Window.Set_Default_Size(Mainwin.Window, 300, 200);
  204.      
  205.      
  206.      -- New Vbox. --
  207.      Gtk.Box.Gtk_New_Vbox (Mainwin.Mainbox, False, 0);      
  208.      
  209.      -- Exit connect. --
  210.      Window_Cb.Connect (Mainwin.window, "destroy",
  211.              Window_Cb.To_Marshaller (Exit_Main'Access),
  212.              Mainwin);
  213.      
  214.      -- Delete connect. --
  215.      Return_Window_Cb.Connect (Mainwin.window, "delete_event",
  216.                 Return_Window_Cb.To_Marshaller (Delete_Event'Access),
  217.                 Mainwin);      
  218.      
  219.      -- Start button.--
  220.      Gtk.Button.Gtk_New(Mainwin.Start_Button, "Start" );
  221.      Window_Cb.Connect (Mainwin.Start_Button, "clicked",
  222.              Window_Cb.To_Marshaller (Start'Access),
  223.              Mainwin);
  224.      
  225.      -- Stop button. --
  226.      Gtk.Button.Gtk_New(Mainwin.Stop_Button, "Stop" );
  227.      Window_Cb.Connect (Mainwin.Stop_Button, "clicked",
  228.              Window_Cb.To_Marshaller (Stop'Access),
  229.              Mainwin);
  230.      
  231.      
  232.      -- New Hbox for Tools. --
  233.      Gtk.Box.Gtk_New_Hbox (Mainwin.Tools_Box, False, 1);      
  234.      
  235.      Gtk.Box.Pack_Start(Mainwin.Tools_Box, Mainwin.Start_Button, False, True);      
  236.      Gtk.Box.Pack_start(Mainwin.Tools_Box, Mainwin.Stop_Button, False, True);
  237.      
  238.      -- Plug-in list edit. --      
  239.      Gtk.Scrolled_Window.Gtk_New(Scrolled);
  240.      Gtk.Box.Gtk_New_Vbox(Plug_List, False, 1);
  241.      for I in Mainwin.Tracks'Range loop
  242.      Gtk.Box.Gtk_New_Hbox(Plug_Box);
  243.      Gtk.Label.Gtk_New(Label, Positive'Image(I));
  244.      Gtk.Combo_Box.Gtk_New_Text(Combo);
  245.     
  246.      Gtk.Combo_Box.insert_Text(Combo, 0, Positive'Image(I) & " Unused" );
  247.      Gtk.Combo_Box.insert_Text(Combo, 1, Positive'Image(I) & " Tempo Sync" );
  248.      Gtk.Combo_Box.insert_Text(Combo, 2, Positive'Image(I) & " 2 voices generator" );
  249.      Gtk.Combo_Box.Set_Active(Combo, 0);
  250.     
  251.      Window_Cb.Connect (Combo, "changed",
  252.                 Window_Cb.To_Marshaller (Plug_Changed'Access),
  253.                 Mainwin);
  254.               
  255.      Gtk.Button.Gtk_New(Button, "Edit" );
  256.     
  257.     
  258.      Plug_Cb.Connect (button, "clicked",
  259.               Plug_Cb.To_Marshaller (Plug_edit'Access),
  260.               Mainwin.Tracks(I));
  261.          
  262.     
  263.      Gtk.Box.Pack_Start(Plug_Box, Label, False, True);
  264.      Gtk.Box.Pack_Start(Plug_Box, Combo, False, True);
  265.      Gtk.Box.Pack_Start(Plug_Box, Button, False, True);
  266.      Gtk.Box.Pack_Start(Plug_List, Plug_Box, false, false);
  267.      end loop;      
  268.      Gtk.Scrolled_Window.Add_With_Viewport(Scrolled, Plug_List);
  269.      
  270.      -- Main pack. --
  271.      Gtk.Box.Pack_Start(Mainwin.Mainbox, scrolled, True, True);
  272.      Gtk.Box.Pack_Start(Mainwin.Mainbox, Mainwin.Tools_Box, false, false);
  273.      
  274.      
  275.      Gtk.Window.Add(Mainwin.Window, Mainwin.Mainbox);
  276.      
  277.      -- Show all window.
  278.      Gtk.Window.Show_All (Mainwin.window);    
  279.      
  280.   end Initialize;
  281.  
  282.  
  283.  
  284.   task body Ultraprocess is
  285.      End_Of_Task : Boolean := False;
  286.   begin
  287.      
  288.      accept Initialize do    
  289.      null;
  290.      end Initialize;      
  291.      while not End_Of_Task loop
  292.      loop
  293.         select
  294.            accept Start;
  295.            for I in Mainwin.Tracks'Range loop
  296.           if Mainwin.Tracks(I) /= null then
  297.              Mainwin.Tracks(I).Track.Start;
  298.           end if;
  299.            end loop;
  300.           
  301.            exit;
  302.         or
  303.            accept Stop;        
  304.         or
  305.            accept Halt;
  306.            End_Of_Task := True;
  307.            exit;
  308.         end select;
  309.      end loop;
  310.      while not End_Of_Task loop
  311.         select
  312.            accept Start;
  313.         or
  314.            accept Stop;
  315.            for I in Mainwin.Tracks'Range loop
  316.           if Mainwin.Tracks(I) /= null then
  317.              Mainwin.Tracks(I).Track.Stop;
  318.           end if;
  319.            end loop;
  320.           
  321.            exit;
  322.         or
  323.            accept Halt;
  324.            End_Of_Task := True;
  325.            exit;
  326.         end select;
  327.      end loop;
  328.      end loop;
  329.      for I in Mainwin.Tracks'Range loop
  330.      if Mainwin.Tracks(I) /= null then
  331.         Mainwin.Tracks(I).Track.Halt;
  332.      end if;
  333.      end loop;
  334.      
  335.   end Ultraprocess;
  336.  
  337.   task body Gen_Track is
  338.      End_Of_Task : Boolean := False;
  339.   begin
  340.      while not End_Of_Task loop
  341.      loop
  342.         select
  343.            accept Start;
  344.            exit;
  345.         or
  346.            accept Stop;        
  347.         or
  348.            accept Halt;
  349.            End_Of_Task := True;
  350.            exit;
  351.         end select;
  352.      end loop;
  353.      if not End_Of_Task then
  354.         accept Run;
  355.      end if;
  356.      while not End_Of_Task loop
  357.         select
  358.            accept Start;
  359.         or
  360.            accept Stop;
  361.            exit;
  362.         or
  363.            accept Halt;
  364.            End_Of_Task := True;
  365.            exit;
  366.         end select;
  367.      end loop;
  368.      if not End_Of_Task then
  369.         accept Suspend;
  370.      end if;
  371.      end loop;
  372.      accept Quit;
  373.   end Gen_Track;
  374.  
  375.  
  376.   task body Tempo_Sync is      
  377.      End_Of_Task : Boolean := False;
  378.   begin
  379.      while not End_Of_Task loop
  380.     
  381.      loop
  382.         select
  383.            Gen.Track.Quit;
  384.            End_Of_Task := True;
  385.            exit;
  386.         or
  387.            delay 0.1;
  388.            select
  389.           Gen.Track.Run;
  390.           exit;
  391.            or
  392.           delay 0.0;
  393.            end select;        
  394.         end select;
  395.      end loop;
  396.      while not End_Of_Task loop
  397.         select
  398.            Gen.Track.Quit;
  399.            End_Of_Task := True;
  400.            exit;
  401.         else
  402.            select
  403.           Gen.Track.Suspend;
  404.           exit;
  405.            else          
  406.           delay 0.25;
  407.           Text_Io.Put("Tempo" );
  408.            end select;
  409.         
  410.         end select;
  411.      end loop;
  412.      end loop;
  413.   end Tempo_Sync;
  414.  
  415.  
  416.   task body Voices_2_Process is
  417.      End_Of_Task : Boolean := False;
  418.   begin
  419.      while not End_Of_Task loop
  420.     
  421.      loop
  422.         select
  423.            Gen.Track.Quit;
  424.            End_Of_Task := True;
  425.            exit;
  426.         or
  427.            delay 0.1;
  428.            select
  429.           Gen.Track.Run;
  430.           exit;
  431.            or
  432.           delay 0.0;
  433.            end select;        
  434.         end select;
  435.      end loop;
  436.      while not End_Of_Task loop
  437.         select
  438.            Gen.Track.Quit;
  439.            End_Of_Task := True;
  440.            exit;
  441.         else
  442.            select
  443.           Gen.Track.Suspend;
  444.           exit;
  445.            else          
  446.           delay 0.5;
  447.           Text_Io.Put("2 voices generator" );
  448.            end select;
  449.         
  450.         end select;
  451.      end loop;
  452.      end loop;
  453.   end Voices_2_Process;
  454.  
  455.  
  456. end Ultrason.Mainwin;


 
 
Ce qui donnne ceci en image : http://reho.st/self/4cd2d17d0e5bca19bd4829655ba25f9d05ca7b19.png
 
 
 
Bref, je sèche sur comment à présent avec mon pointeur passé à la procedure plug_edit, éditer les propriétés du plug in.
Je pense que je m'y suis mal pris.
Si vous pouviez me donner un peutu coup de main. Merci.


Message édité par par l'anneau de l'ia le 29-04-2015 à 00:41:45

---------------
Toute expression prend un sens spirituel qui nous influence dans notre quête de l'Homme.
mood
Publicité
Posté le 28-04-2015 à 20:54:11  profilanswer
 

n°2256830
par l'anne​au de l'ia
word master
Posté le 29-04-2015 à 00:04:56  profilanswer
 

Re-bonjour.
 
 
Je ne sais pas si je part dans la bonne direction.
Enfin. J'ai mis ma liste de bouton edit dans un tableau de ma fenêtre principale pour les connecter aux plug-ins lors de la selection du plug-in.
Et ça passe.
 

Code :
  1. package Plug_Cb is new Gtk.Handlers.User_Callback (Gtk.Widget.Gtk_Widget_Record, Generator_access);
  2.  
  3.   procedure Edit (User_Data : Tempo_Generator_Type'Class) is
  4.   begin
  5.      Text_Io.Put_line("Tempo Edit..." );
  6.   end Edit;
  7.  
  8.   procedure Edit (User_Data : Voices_2_Generator_Type'Class) is
  9.   begin
  10.      Text_Io.Put_line("Voices 2 Edit..." );
  11.   end Edit;
  12.  
  13.  
  14.   procedure Plug_Edit (Object : access Gtk_Widget_Record'Class;
  15.                        User_Data : Generator_Access) is
  16.  
  17.   begin
  18.      Text_Io.Put("Plug Edit : " );
  19.      if User_Data = null then
  20.         Text_Io.Put_Line("Unused =>" );
  21.      else
  22.         if User_Data.all in Tempo_Generator_Type then
  23.            Text_Io.Put_Line("Tempo =>" );
  24.            Edit(Tempo_Generator_Type(User_Data.all));
  25.         elsif
  26.           User_Data.all in Voices_2_Generator_Type then
  27.            Text_Io.Put_Line("Voices 2 =>" );
  28.            Edit(Voices_2_Generator_Type(User_Data.all));
  29.  
  30.         end if;
  31.      end if;
  32.   end Plug_Edit;


 
Mais problème, je suis, je crois que ça s'appelle caster, donc de caster les objets pointé pour que l'éguillage se fasse.
 
 
La procedure de selection pour la connection qu'il y ai pas d'ambiguïtés !
 

Code :
  1. procedure Plug_Changed (Object : access Gtk_Widget_Record'Class;
  2.                           User_Data : Ultra_Address_To_Access.Object_Pointer) is
  3.  
  4.      Plug_Id : constant Natural := Natural(Gtk.Combo_Box.Get_Active(Gtk.Combo_Box.Gtk_Combo_Box(Object)));
  5.      Plug_Num : Positive := 1;
  6.   begin
  7.      Plug_Num := Integer'Value(Gtk.Combo_Box.Get_Active_Text(Gtk.Combo_Box.Gtk_Combo_Box(Object))(1..2));
  8.      case Plug_Id is
  9.         when 0 =>
  10.            User_Data.all.Tracks(Plug_Num) := null;
  11.         when 1 =>
  12.            User_Data.all.Tracks(Plug_Num) := new Tempo_Generator_Type;
  13.            Plug_Cb.Connect (User_Data.Edit_List(Plug_Num), "clicked",
  14.                             Plug_Cb.To_Marshaller (Plug_edit'Access),
  15.                             User_Data.all.Tracks(Plug_Num),
  16.                             After => True);
  17.         when 2 =>
  18.            User_Data.all.Tracks(Plug_Num) := new Voices_2_Generator_Type;
  19.            Plug_Cb.Connect (User_Data.Edit_List(Plug_Num), "clicked",
  20.                             Plug_Cb.To_Marshaller (Plug_edit'Access),
  21.                             User_Data.all.Tracks(Plug_Num),
  22.                             After => True);
  23.         when others =>
  24.            null;
  25.      end case;
  26.  
  27.   end Plug_Changed;


Message édité par par l'anneau de l'ia le 29-04-2015 à 00:16:54

---------------
Toute expression prend un sens spirituel qui nous influence dans notre quête de l'Homme.
n°2256832
par l'anne​au de l'ia
word master
Posté le 29-04-2015 à 00:43:28  profilanswer
 

Il suffis d'ajouter une ligne pour déconnecter les signaux précédemment connecté pour pas qu'il y ai de multiple appelle selon les multiple selections.
 

Code :
  1. Gtk.Handlers.Handlers_Destroy (User_Data.Edit_List(Plug_Num));


Avant de reconnecter un signal aux boutons.


Message édité par par l'anneau de l'ia le 29-04-2015 à 00:43:41

---------------
Toute expression prend un sens spirituel qui nous influence dans notre quête de l'Homme.

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Ada

  [Ada][Resolu]Editer les propriétés des plug-ins (GtkAda)

 

Sujets relatifs
[Gnu/Linux][X Window[Ada][GtkAda] Over Gnu/Linux/X Window/Ada/GtkAdaDrag drop & changer les propriétés
Pertes propriétés Active X lorsque copier-collerHyper lien pour éditer un fichier parmi plusieurs
Plug in Flash mouvement de souris via Kinect[Résolu] Aide programmation recherche propriétés lnk en vbs
(fichier mui)Comment éditer les messages du jeu dame de pique Windows?Invisibilité
editer JTable contenant des entiers[Ada][Warborg] un wargame avec GtkAda
Plus de sujets relatifs à : [Ada][Resolu]Editer les propriétés des plug-ins (GtkAda)


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR