From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,STOX_REPLY_TYPE autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2339842f2a89f4a9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.33.71 with SMTP id p7mr1376641pbi.1.1316687056457; Thu, 22 Sep 2011 03:24:16 -0700 (PDT) Path: lh7ni2476pbb.0!nntp.google.com!news1.google.com!goblin1!goblin2!goblin.stu.neva.ru!multikabel.net!newsfeed20.multikabel.net!feed.xsnews.nl!border-2.ams.xsnews.nl!upload-2.xsnews.nl!10.10.69.17.MISMATCH!frontend-F09-17.ams.news.kpn.nl From: "ldries46" Newsgroups: comp.lang.ada References: <4e7a8d90$0$5570$703f8584@news.kpn.nl> In-Reply-To: Subject: Re: Closing a program with GTK Date: Thu, 22 Sep 2011 12:24:03 +0200 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3538.513 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 Message-ID: <4e7b0d07$0$2638$703f8584@news.kpn.nl> Organization: KPN.com NNTP-Posting-Host: 77.168.179.107 X-Trace: 1316687111 news.kpn.nl 2638 77.168.179.107@kpn/77.168.179.107:52308 Xref: news1.google.com comp.lang.ada:18089 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Date: 2011-09-22T12:24:03+02:00 List-Id: I just have corrected the problem for the quit menu button, and that worked. Thanks for that. But the problem with the Close button on top of the window stays The code of the procedures is now procedure On_Quit1_Activate (Object : access Gtk_Image_Menu_Item_Record'Class) is pragma Unreferenced (Object); begin On_Window_Destroy(Transc_AdaWindow); end On_Quit1_Activate; and procedure On_Window_Destroy (Object : access Gtk_Widget_Record'Class) is pragma Unreferenced (Object); begin Close_Ini; Gtk.Main.Main_Quit; end On_Window_Destroy; In the package where I am initiating the handlers I have the following lines package Destroy_Callback is new Gtk.Handlers.Callback (Gtk_Widget_Record); -------------------------------------------------------------------------------- -- Creation Destroy action -------------------------------------------------------------------------------- Destroy_Callback.Connect( Transc_Ada, "destroy", Destroy_Callback.To_Marshaller (On_Window_Destroy'Access), False); I expected the close button to got to the On_Window_Destroy routine but instead it goes to the gtk.object.Destroy routine I can see in the GPS debugger the exact position where it goes wrong by placing a breakpoint in that Destroy routine. "Dmitry A. Kazakov" schreef in bericht news:ec116uy7j718$.1urzzp7i6tpth$.dlg@40tude.net... On Thu, 22 Sep 2011 03:21:00 +0200, ldries46 wrote: See: http://rosettacode.org/wiki/Simple_windowed_application#Ada for proper handling of application exiting. In particular, Gtk.Main.Main_Quit must be called from Destroy handler. Delete event handler must return False. > When debugging in GPS I found that the message is generated in the > gtk_object package in the Destroy routine at the moment that you enter the > Internal routine with the Step button You cannot debug Gtk applications in the debugger. Use tracing and error Glib logging. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de