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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,faac757f0214fa1d,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-06 21:05:22 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!tethys.csu.net!pln-w!spln!dex!extra.newsguy.com!newsp.newsguy.com!hopperj From: jim hopper Newsgroups: comp.lang.ada Subject: X11 binding with FSF version of gnat Date: Thu, 06 Feb 2003 23:49:19 -0500 Organization: http://extra.newsguy.com Message-ID: <060220032349197450%hopperj@macconnect.com> NNTP-Posting-Host: p-132.newsdawg.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Thoth/1.5.10 (Carbon/OS X) Xref: archiver1.google.com comp.lang.ada:33862 Date: 2003-02-06T23:49:19-05:00 List-Id: 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