comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Menu Exit, Red Button and Uncontrolled exits
Date: Mon, 27 Apr 2009 18:06:06 +0200
Date: 2009-04-27T18:06:06+02:00	[thread overview]
Message-ID: <1d9cgllpnu7rk$.gqh0uhzilgi4$.dlg@40tude.net> (raw)
In-Reply-To: 49f5c344$0$6682$703f8584@textnews.kpn.nl

On Mon, 27 Apr 2009 16:38:07 +0200, ldries46 wrote:

> I want in ADA with GTKADA in my program make use of the same exit handler 
> with the Exit in the menu structure, the Windows standard exit button and in 
> case of some uncontrolled exit ( all destructive exceptions ).
> I have the handler for the exit button, how can I create rerouting for the 
> other two so that in either case the program stops in thye same controlled 
> way.

GtkAda functions in a way that Ada procedures (callbacks) are called from
Gtk, which in turn is called from Ada's main task. So you can only catch
the exceptions within the callbacks. If they propagate further to Gtk, that
mould most likely crash your program. So if you meant to catch an exception
in a callback, then you could emit a button click event for exit button
from there. A simple way to do it is to call Clicked

https://libre.adacore.com/GtkAda/docs/2.8/gtkada_rm/gtk-button.html#Clicked_24_

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



      reply	other threads:[~2009-04-27 16:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-27 14:38 Menu Exit, Red Button and Uncontrolled exits ldries46
2009-04-27 16:06 ` 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