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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: GTk3 without the Gtkbuilder and Glad Date: Fri, 10 Jun 2016 21:55:10 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <575b0403$0$12046$e4fe514c@news.kpn.nl> NNTP-Posting-Host: w/2xSGckQeJEFvqsQFNodA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:30687 Date: 2016-06-10T21:55:10+02:00 List-Id: On 2016-06-10 20:16, ldries46 wrote: > I want to create a Callback routine that in each case where the program > can be stopped can be called. Let us say : On_Quit. > I can make that routine and let it run from the menu or some error, But > I cannot find the way to run this routine from the destroy button of the > window. How should I do that? The signal issued at an attempt to close the top-level window is "delete-event". It can be ignored, if the window must stay. The signal issued upon object destruction (window included) is "destroy". It cannot be rejected. Typically Gtk.Main.Main_Quit is called from the handler of the main window's "destroy". P.S. Maybe GLADE already calls Gtk.Main.Main_Quit, but you still can connect to "destroy". P.P.S. It is a bad place to store settings upon handling "destroy" because they can be lost on application crash. A better strategy is to do it from a timer, say each 30s or so. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de