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,65b902127ca8a604 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Issue with GNAT GPL 2009 and GtkAda 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: <4A414EBB.8060204@free.fr> Date: Wed, 24 Jun 2009 09:40:03 +0200 Message-ID: NNTP-Posting-Date: 24 Jun 2009 09:40:03 CEST NNTP-Posting-Host: 573c182f.newsspool2.arcor-online.net X-Trace: DXC=;gmTI]U82Idf1oJaJ0@dmgA9EHlD;3Ycb4Fo<]lROoRa^YC2XCjHcbi`d7CP3Joi5kDNcfSJ;bb[eFCTGGVUmh?dLK[5LiR>kgb@c9;<_EibLc X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:6587 Date: 2009-06-24T09:40:03+02:00 List-Id: On Tue, 23 Jun 2009 23:52:59 +0200, Damien Carbonne wrote: > When compiling a program I had written to GNAT GPL 2009 on Linux and > Windows, I met a problem with the usage of Gtk.Tree_Model.Foreach. > > I wrote a relatively small program (unfortunately, still quite long) > that reproduces the problem (attached in the end). > > I wonder if this is a bug in > 1) my program, > 2) GtkAda or > 3) GNAT GPL 2009. > What surprises me is that it was quite hard to reproduce this problem. > Most other examples I wrote with Foreach worked very well. > I don't know how GNAT handles accessibility rules. > I wonder if the problem is not related to the usage of Interfaces ? > I did not try yet to change the program so that it can work, but other > examples I wrote were quite similar, except that they did not use > interfaces. I'll check, but do you have any idea on this issue ? Well, it is difficult to say, I never used foreach. I do Gtk_Tree_Iter instead. I looked briefly at the implementation of Foreach in GtkAda and found nothing offending. Interface should not be a problem. Run-time accessibility checks is always a *huge* problem. If in doubt use Unchecked_Access everywhere. I know it is disgusting, but so is the propagation of a Constraint_Error at run-time. Other possible issues: 1. Types extending GtkAda types must be library-level 2. Text_IO shall not be used (may cause exception propagation at least on some platforms, with a subsequent crash. Ada exceptions propagated through Gtk almost certainly crash the program. You cannot catch them) 3. In your code there is no "unref" the model after Set_Model. Tree model is not a widget, it must be explicitly unreferenced. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de