comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Ada OpenGL question
Date: Tue, 15 Sep 2009 11:19:42 -0700 (PDT)
Date: 2009-09-15T11:19:42-07:00	[thread overview]
Message-ID: <e6fcfe04-9ccb-4f37-be5a-ecf64bc2a35a@k26g2000vbp.googlegroups.com> (raw)
In-Reply-To: 4aafcc54$0$2860$ba620e4c@news.skynet.be

On Sep 15, 7:18 pm, Olivier Scalbert <olivier.scalb...@algosyn.com>
wrote:
> Hi all,
>
> I have found some OpenGL code there:http://adaopengl.sourceforge.net/downloads.php
>
> I manage to get it compiled on my linux box but when I run it, I have:
>
> raised SYSTEM.ASSERTIONS.ASSERT_FAILURE : Handlers for "expose_event" on
> a GtkGLArea should be functions
>
> So it looks I have problem with callbacks somewhere around:
> Destroy_CB.Connect(MyGL, "destroy", Destroy_CB.To_Marshaller( Quit'Access));
>
> Expose_CB.Connect(MyGL, "expose_event", Expose_CB.To_Marshaller(
> Expose'Access));
>
> Resize_CB.Connect(MyGL, "configure_event", Resize_CB.To_Marshaller(
> Reshape'Access));
>
> All the files are located there:http://scalbert.dyndns.org/ada/adagtkgl/
>
> If somebody can help me, I would appreciate !
>
> Thanks,
>
> Olivier

In your example, Expose'Access presumably designates a procedure.
This is wrong.  Expose should be a function returning Boolean.  The
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 at http://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

--
Ludovic Brenta.



  reply	other threads:[~2009-09-15 18:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-15 17:18 Ada OpenGL question Olivier Scalbert
2009-09-15 18:19 ` Ludovic Brenta [this message]
2009-09-16  6:43   ` Olivier Scalbert
2009-09-16  7:34     ` Ludovic Brenta
2009-09-16 11:51       ` Olivier Scalbert
replies disabled

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