with Gtk.Menu_Item; use Gtk.Menu_Item; with Gtk; use Gtk; with Gtk.Main; use Gtk.Main; with Glib.Error; use Glib.Error; with Gtk.Widget; use Gtk.Widget; with Gtk.Dialog; use Gtk.Dialog; with Gtk.Button; use Gtk.Button; with Gtk.About_Dialog; use Gtk.About_Dialog; with Gtk.Label; use Gtk.Label; with Ada.Text_IO; use Ada.Text_IO; with Ada.IO_Exceptions; use Ada.IO_Exceptions; with GNAT.Current_Exception; use GNAT.Current_Exception; with Gtk.File_Chooser; use Gtk.File_Chooser; with Gtk.File_Chooser_Dialog; use Gtk.File_Chooser_Dialog; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Translate; use Translate; with Framework_Config; use Framework_Config; with Project; use Project; with Xml_generic_Parsers; use Xml_generic_Parsers; with Xml_generic_Parsers.architecture; use Xml_generic_Parsers.architecture; with graphical_editor.user_message; use graphical_editor.user_message; with Glib; use Glib; with Glib.Object; use Glib.Object; with Gtk.Text_Buffer; use Gtk.Text_Buffer; with graphical_editor.event_analyzers; use graphical_editor.event_analyzers; package body graphical_editor.read_event_analyzers_callbacks is procedure read_file (Object : access Gtkada_Builder_Record'Class) is pragma Unreferenced (Object); Open_File_Chooser: GObject; Read_File_Name : Unbounded_string; begin --Do_Open; Open_File_Chooser :=Get_Object(Object, "filechooserdialog1"); Read_File_Name := To_Unbounded_String (Get_Filename (+(Gtk_File_Chooser_Dialog(Open_File_Chooser)))); --faire un controle ici ... pour recuperer juste le nom du fichier ... Gtk.Text_Buffer.Set_Text (read_buffer, to_string(Read_File_Name)); --Unref(Open_File_Chooser); --Hide(Gtk_Widget(Open_File_Chooser)); Destroy_cb(Gtk_Widget(Open_File_Chooser)); gtk.main.main_quit; end read_file; procedure cancel (Object : access Gtkada_Builder_Record'Class) is pragma Unreferenced (Object); Open_File_Chooser : GObject; begin Open_File_Chooser :=Get_Object(Object, "filechooserdialog1"); --Unref(Open_File_Chooser); --Hide(Gtk_Widget(Open_File_Chooser)); Destroy_cb(Gtk_Widget(Open_File_Chooser)); gtk.main.main_quit; end cancel; end graphical_editor.read_event_analyzers_callbacks;