comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: GTk3 without the Gtkbuilder and Glad
Date: Fri, 10 Jun 2016 21:55:10 +0200
Date: 2016-06-10T21:55:10+02:00	[thread overview]
Message-ID: <njf5v8$11pa$1@gioia.aioe.org> (raw)
In-Reply-To: 575b0403$0$12046$e4fe514c@news.kpn.nl

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


      parent reply	other threads:[~2016-06-10 19:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 18:16 GTk3 without the Gtkbuilder and Glad ldries46
2016-06-10 18:38 ` Jeffrey R. Carter
     [not found]   ` <575bcceb$0$28281$e4fe514c@news.kpn.nl>
2016-06-11 17:38     ` Jeffrey R. Carter
2016-06-12  7:50       ` ldries46
2016-06-12 17:10         ` Jeffrey R. Carter
2016-06-13  7:40           ` ldries46
2016-06-13 15:50             ` Jeffrey R. Carter
2016-06-10 19:55 ` Dmitry A. Kazakov [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox