[gtkada] Version 1.3.12 of GTKAda for Windows

Emmanuel Briot briot at ACT-Europe.FR
Mon Aug 13 16:12:18 CEST 2001


Chris Sparks writes:
 > I just installed 1.3.12 and I still find an error in the
 > Gdk.Get_Event_Type procedure that I saw back in 1.3.8.  When I use this
 > function after knowing that I have an event pending, needing to be
 > processed, I get a access violation.

Note that the current version of GtkAda (in CVS) no longer has a Get_Event_Type
function written in Ada, so your patch doesn't apply (this is a pragma Import
directly). However, it would still have the same problem if you pass it a
Null_Event in parameter.

We have added the following comment to gdk-event.ads:

   --  The following functions can be used to retrieve some specific fields
   --  from an event. Some of these fields do not exist for all the types of
   --  events (see the description of each event for a list of the relevant
   --  fields).
   --  Note also that you can not pass a null event to them. The parameter must
   --  be a correct event, or the result is undefined.


This means that you need to test yourself whether the event is null.
In fact, it it strange that you get a null_event, and this should be checked
carefully in your program. This is not something we have seen before.


 > I don't understand why I get a null coming back, however, without this
 > fix my software doesn't work.

Can't you simply add a test that the event is not a Null_Event (or null, with
the more recent versions of GtkAda). This means that your software would work
whether or not GtkAda tests this, and you don't have to patch it every time we
make a new release.

Where do you get the event from (parameter to a callback, ...) ?

Emmanuel





More information about the gtkada mailing list