[gtkada] testgtk/testcairo.adb patch proposal.

Nicolas Setton setton at adacore.com
Mon Jul 16 16:54:54 CEST 2012


Hello Pascal,

we have integrated this one in the development branch.

Thanks a lot for your contributions!

Nicolas

On 14 Jul 2012, at 09:41, Pascal wrote:

> Hello, in testgtk-testcairo from GtkAda GPL 2012, the program doesn't exit when closing the window.
> Here is a patch proposal:
> 
> --- ./testcairo.adb.0	2012-05-18 10:03:44.000000000 +0200
> +++ ./testcairo.adb	2012-07-12 09:41:26.000000000 +0200
> @@ -67,6 +67,18 @@
> 
>    --  The tests implemented in this example program
> 
> +   package Window_Cb is new Gtk.Handlers.Return_Callback
> +     (Gtk_Window_Record, Boolean);
> +   --  Callback for delete_event.
> +   function On_Main_Window_Delete_Event
> +     (Object : access Gtk_Window_Record'Class) return Boolean
> +   is
> +      pragma Unreferenced (Object);
> +   begin
> +      Gtk.Main.Main_Quit;
> +      return True;
> +   end On_Main_Window_Delete_Event;
> +
>    package Event_Cb is new Gtk.Handlers.Return_Callback
>      (Gtk_Drawing_Area_Record, Boolean);
> 
> @@ -284,6 +296,10 @@
>    Event_Cb.Connect (Area, "expose_event",
>                      Event_Cb.To_Marshaller (Expose_Cb'Access));
> 
> +   Window_Cb.Connect
> +     (Win, "delete_event",
> +      Window_Cb.To_Marshaller (On_Main_Window_Delete_Event'Access));
> +
>    Show_All (Win);
>    Gtk.Main.Main;
> end Testcairo;
> 
> HTH, Pascal.
> http://blady.pagesperso-orange.fr
> 
> 
> _______________________________________________
> gtkada mailing list
> gtkada at lists.adacore.com
> http://lists.adacore.com/mailman/listinfo/gtkada
> 



More information about the gtkada mailing list