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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,85da987ca274defa X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Menu Exit, Red Button and Uncontrolled exits Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <49f5c344$0$6682$703f8584@textnews.kpn.nl> Date: Mon, 27 Apr 2009 18:06:06 +0200 Message-ID: <1d9cgllpnu7rk$.gqh0uhzilgi4$.dlg@40tude.net> NNTP-Posting-Date: 27 Apr 2009 18:06:06 CEST NNTP-Posting-Host: 7755e429.newsspool3.arcor-online.net X-Trace: DXC=cSQni2G>bV_mG86`U=_nC_McF=Q^Z^V3X4Fo<]lROoRQ^YC2XCjHcbY1k1BXNbGj`TDNcfSJ;bb[UFCTGGVUmh?TLK[5LiR>kgREfKN^cJLBTU X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:5559 Date: 2009-04-27T18:06:06+02:00 List-Id: 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