Why not use a full Ada implementation ? :) We plan offering our XInAda Xlib under GPL, but need to allocate some time to do it. The entire XInAda library set includes Toolkit and 1.2 Motif widget set 100% Ada95 Jean-Claude MAHIEUX Top Graph'X Sales Manager 10 All�e de la Mare Jacob 91290 La Norville - FRANCE Tel : +33 1 69 26 97 88 Fax : +33 1 69 26 97 89 Email : sales@topgraphx.com URL : http://www.topgraphx.com German Representative : orbriver-de@topgraphx.com US Representative : sroliver@topgraphx.com "jim hopper" a �crit dans le message de news: 060220032349197450%hopperj@macconnect.com... > From: james hopper > > I am having a bit of a problem with x11 bindings when compiled for osx > (the intermetrics bindings updated for linux). I was hoping someone > might have worked with the bindings on os x or have some idea whats > going on. This is using the os x version of gnat, so i don't know if > its a problem with our version of gnat or something that is specif to > gnat 5x. > > problem is this: > > there is a type in x-xlib.ads that looks like this: > > type XEvent (Event_Type: X.signed_int := X.LASTEvent + 1) is record > -- Xlib.h:934 > serial : X.unsigned_long; -- > Xlib.h:902 > send_event : Bool; -- > Xlib.h:903 > display : XDisplay_access; -- > Xlib.h:904 > case Event_Type is > when X.KeyPress | X.KeyRelease => > xkey : XKeyEvent; -- Xlib.h:937 > when X.ButtonPress | X.ButtonRelease => > xbutton : XButtonEvent; -- Xlib.h:938 > ... > > its used in test sample called basicwin.adb where the type is > instantiated as > > Report : aliased X.Xlib.XEvent; > > (note its using the default for the descriminant > > ok now its used like this: > > loop > X.Xlib.XNextEvent(Display, Report'access); > ada.text_io.put_line("Here" & X.signed_int'image(Report.Event_Type) & > Integer'image(Report'size/8)); > case (Report.Event_Type) is > when X.Expose => > ada.text_io.put_line("Expose"); > ... > when X.ConfigureNotify => > ada.text_io.put_line("ConfigureNotify"); > ada.text_io.put_line("width = " & > integer'image(integer(Report.Xconfigure.Width))); > ada.text_io.put_line("height = " & > X.signed_int'image(Report.Xconfigure.Height)); > ... > when ... > > i thought at first the problem was it wasnt being allocated because > when you use the debugger and stop right after the xnextevent and do > "print report" it shows report as a null record, however if i do > > x/20 report'address > > i can see that the data is all there and looks correct. > > when i try to access the height and width field in x.configurenotify > version of the variant record, the print statements above it gets a > constraint error. if i change x-xlib.ads to use x.xconfignotify as the > default descriminant then the height and width are fine, but then > expose variant gets a constraint error when it tries to access internal > fields of the expose variant. > > This looks like either a compiler problem, or something thats changed > from 3.13 (which i used the bindings for before) that doesnt like the > variant being changed behind the compilers back. oh yes and i have to > use -gnatp or it always blows up when i try to access it with > constraint error in the descriminant. > > Any information on this would help. > > thanks jim