[gtkada] testgtk/main_windows.adb patch proposal.

Pascal p.p14 at orange.fr
Wed Jul 11 21:24:09 CEST 2012


Hello, in testgtk-main_windows from GtkAda GPL 2012, Help dialog is not destroyed when closing the window.
Here is a patch proposal:

--- ./testgtk/main_windows.adb.0	2012-05-18 10:03:33.000000000 +0200
+++ ./testgtk/main_windows.adb	2012-07-10 22:18:55.000000000 +0200
@@ -158,7 +158,7 @@
    package Notebook_Cb is new Gtk.Handlers.User_Callback
      (Gtk_Notebook_Record, Gtk_Notebook);
 
-   Help_Dialog : Gtk.Dialog.Gtk_Dialog;
+   Help_Dialog : aliased Gtk.Dialog.Gtk_Dialog;
    Help_Text   : Gtk.Text_Buffer.Gtk_Text_Buffer;
    --  The dialog used to display the help window
 
@@ -522,6 +522,10 @@
                      Auto_Shrink => True);
          Set_Title (Help_Dialog, "testgtk help");
          Set_Default_Size (Help_Dialog, 640, 450);
+         Destroy_Dialog_Handler.Connect
+           (Help_Dialog, "destroy",
+            Destroy_Dialog_Handler.To_Marshaller (Destroy_Dialog'Access),
+            Help_Dialog'Access);
 
          Set_Spacing (Get_Vbox (Help_Dialog), 3);
 
HTH, Pascal.
http://blady.pagesperso-orange.fr




More information about the gtkada mailing list