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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,efe941d6d79d0fa7 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!g6g2000vbr.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Ada OpenGL question Date: Wed, 16 Sep 2009 00:34:40 -0700 (PDT) Organization: http://groups.google.com Message-ID: <07d3520d-0c53-4359-aa50-9f4fe466edd8@g6g2000vbr.googlegroups.com> References: <4aafcc54$0$2860$ba620e4c@news.skynet.be> <4ab08904$0$2848$ba620e4c@news.skynet.be> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1253086481 5816 127.0.0.1 (16 Sep 2009 07:34:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 16 Sep 2009 07:34:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g6g2000vbr.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8342 Date: 2009-09-16T00:34:40-07:00 List-Id: Olivier Scalbert wrote: > Ludovic Brenta wrote: >> In your example, Expose'Access presumably designates a procedure. >> This is wrong. =A0Expose should be a function returning Boolean. =A0The >> return value means: >> >> False: pass the signal to any other signal handlers attached to it >> True: abort processing of the signal. >> >> The same holds for delete_event and a few other signals as documented >> in the GTK+ reference athttp://www.gtk.org. >> >> The GtkAda signal handler infrastructure makes it impossible to detect >> the type mismatch at compile time, so it has run-time checks instead. >> This is the source of the error message. >> >> HTH > > Thanks for your help Ludovic! > > I do not know how to solve it. > I have tried to change the Expose procedure into a function returning a > Boolean, but then it does not compile anymore: > > gtkgl.adb:89:66: no candidate interpretations match the actuals: > gtkgl.adb:89:87: expected type "Handler" defined at > gtk-marshallers.ads:355, instance at gtk-handlers.ads:915, instance at > line 68 > gtkgl.adb:89:87: found type access to function "Expose" defined at line 8= 9 > gtkgl.adb:89:87: =A0 =3D=3D> in call to "To_Marshaller" at > gtk-handlers.ads:939, instance at line 68 > gtkgl.adb:89:87: =A0 =3D=3D> in call to "To_Marshaller" at > gtk-handlers.ads:934, instance at line 68 > gtkgl.adb:89:87: =A0 =3D=3D> in call to "To_Marshaller" at > gtk-handlers.ads:930, instance at line 68 > gtkgl.adb:89:87: =A0 =3D=3D> in call to "To_Marshaller" at > gtk-handlers.ads:926, instance at line 68 > gtkgl.adb:89:87: =A0 =3D=3D> in call to "To_Marshaller" at > gtk-handlers.ads:922, instance at line 68 > gtkgl.adb:89:87: =A0 =3D=3D> in call to "To_Marshaller" at > gtk-handlers.ads:918, instance at line 68 You must call GtkAda.Handlers.Return_Callback.Connect as opposed to GtkAda.Handlers.Widget_Callback.Connect. (If you use some other instances of Gtk.Handlers, the same holds: Return_Callback instead of Callback). -- Ludovic Brenta.